Skip to content

Commit

Permalink
Test formating and usuing collections extensions
Browse files Browse the repository at this point in the history
  • Loading branch information
caraplana1 committed May 22, 2024
1 parent 9e8ca49 commit e6f1811
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 15 deletions.
8 changes: 4 additions & 4 deletions Tests/ComicCreators/CbzFiles.cs
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,10 @@ public void CreateCbz()
File.Delete($"{cbzPath}.cbz");
}

[Fact]
public void ImagesNotFound()
{
string[] files = { "Fakename", "fakename2", "fakename3" };
[Fact]
public void ImagesNotFound()
{
string[] files = ["Fakename", "fakename2", "fakename3"];

Assert.Throws<IOException>(() => ComicBuilder.CreateCBZ(files, cbzPath));
}
Expand Down
10 changes: 4 additions & 6 deletions Tests/ComicCreators/PdfFiles.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
using Xunit;
using System;
using System.Linq;
using System.Collections.Generic;
using System.IO;
using ComicConverter;

Expand All @@ -21,11 +19,11 @@ public void CreatePdf()
File.Delete("pdftest.pdf");
}

[Fact]
[Fact]
public void FilesAreNotImages()
{
var images = Directory.GetFiles(Samples.IMAGESDIR);
images = images.ToList().Append(Samples.FAKEIMAGE).ToArray();
{
var images = Directory.GetFiles(Samples.IMAGESDIR);
images = [.. images, Samples.FAKEIMAGE];

Assert.ThrowsAny<Exception>(() => ComicBuilder.CreatePdf(images, "pdftest"));
}
Expand Down
3 changes: 1 addition & 2 deletions Tests/ImageCollectors/CbrFiles.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
using Xunit;
using System.IO;
using System.Linq;
using ComicConverter;
using System.Collections.Generic;

Expand Down Expand Up @@ -40,7 +39,7 @@ public void EmptyAttributeDirectory()
ImageExtractors.UnRar(Samples.CBRPATH, "Folder");
ImageExtractors.UnRar(Samples.CBRPATH);

List<string> filesExtracted = Directory.GetFiles(".").ToList<string>();
List<string> filesExtracted = [.. Directory.GetFiles(".")];

foreach (var file in Directory.GetFiles("Folder"))
{
Expand Down
1 change: 0 additions & 1 deletion Tests/ImageCollectors/CbtFiles.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
using System.IO;
using System;
using System.Collections.Generic;
using System.Linq;
using ComicConverter;
using Xunit;
Expand Down
3 changes: 1 addition & 2 deletions Tests/ImageCollectors/CbzFiles.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
using Xunit;
using System.IO;
using System.Linq;
using ComicConverter;
using System.Collections.Generic;

Expand Down Expand Up @@ -45,7 +44,7 @@ public void EmptyAttributeDirectory()
ImageExtractors.UnZip(Samples.CBZPATH, folderToCompare);

// Get a list of all files in current directory
List<string> filesExtracted = Directory.GetFiles(".").ToList<string>();
List<string> filesExtracted = [.. Directory.GetFiles(".")];

foreach (var file in Directory.GetFiles(folderToCompare))
{
Expand Down

0 comments on commit e6f1811

Please sign in to comment.