Skip to content

Commit

Permalink
Code cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
vers-one committed May 24, 2024
1 parent 8b7376d commit 50c6684
Show file tree
Hide file tree
Showing 32 changed files with 365 additions and 335 deletions.
48 changes: 24 additions & 24 deletions Source/VersOne.Epub.ConsoleDemo/VersOne.Epub.ConsoleDemo.csproj
Original file line number Diff line number Diff line change
@@ -1,31 +1,31 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net7.0</TargetFramework>
<RuntimeIdentifiers>win10-x64</RuntimeIdentifiers>
<Authors>vers</Authors>
<Copyright>vers, 2015-2022</Copyright>
<Version>3.3.1</Version>
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net7.0</TargetFramework>
<RuntimeIdentifiers>win10-x64</RuntimeIdentifiers>
<Authors>vers</Authors>
<Copyright>vers, 2015-2024</Copyright>
<Version>3.3.1</Version>
<EnforceCodeStyleInBuild>True</EnforceCodeStyleInBuild>
<DocumentationFile></DocumentationFile>
<GenerateDocumentationFile>True</GenerateDocumentationFile>
<TreatWarningsAsErrors>True</TreatWarningsAsErrors>
</PropertyGroup>
<ItemGroup>
<AdditionalFiles Include="stylecop.json" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="HtmlAgilityPack" Version="1.11.46" />
<PackageReference Include="SonarAnalyzer.CSharp" Version="9.0.0.68202">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="StyleCop.Analyzers" Version="1.2.0-beta.406">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\VersOne.Epub\VersOne.Epub.csproj" />
</ItemGroup>
<ItemGroup>
<AdditionalFiles Include="stylecop.json" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="HtmlAgilityPack" Version="1.11.61" />
<PackageReference Include="SonarAnalyzer.CSharp" Version="9.25.0.90414">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="StyleCop.Analyzers" Version="1.2.0-beta.406">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\VersOne.Epub\VersOne.Epub.csproj" />
</ItemGroup>
</Project>
4 changes: 2 additions & 2 deletions Source/VersOne.Epub.Test/Integration/Runner/TestRunner.cs
Original file line number Diff line number Diff line change
Expand Up @@ -69,11 +69,11 @@ public void GenerateTestCaseTemplates()
return testCaseSerializer.Deserialize(testCasePath, testEpubPath);
}

public static IEnumerable<object[]> GetTestCaseDirectories()
public static TheoryData<string> GetTestCaseDirectories()
{
List<string> directories = new();
GetTestCaseDirectories(rootTestCasesDirectory, directories);
return directories.Select(directory => new[] { directory });
return new(directories);
}

private static void GetTestCaseDirectories(string currentDirectory, List<string> directories)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ public void LocalTextContentFileRefReadContentTest()
}

[Fact(DisplayName = "Reading local text content file asynchronously should succeed")]
public async void LocalTextContentFileRefReadContentAsyncTest()
public async Task LocalTextContentFileRefReadContentAsyncTest()
{
TestEpubContentLoader testEpubContentLoader = new(TEXT_FILE_CONTENT);
EpubLocalTextContentFileRef epubLocalTextContentFileRef = new(LocalTextFileRefMetadata, LOCAL_TEXT_FILE_PATH, testEpubContentLoader);
Expand All @@ -163,7 +163,7 @@ public void LocalByteContentFileRefReadContentTest()
}

[Fact(DisplayName = "Reading local byte content file asynchronously should succeed")]
public async void LocalByteContentFileRefReadContentAsyncTest()
public async Task LocalByteContentFileRefReadContentAsyncTest()
{
TestEpubContentLoader testEpubContentLoader = new(BYTE_FILE_CONTENT);
EpubLocalByteContentFileRef epubLocalByteContentFileRef = new(LocalByteFileRefMetadata, LOCAL_BYTE_FILE_PATH, testEpubContentLoader);
Expand All @@ -181,7 +181,7 @@ public void LocalContentFileRefReadContentAsTextTest()
}

[Fact(DisplayName = "Reading local content file as text asynchronously should succeed")]
public async void LocalContentFileRefReadContentAsTextAsyncTest()
public async Task LocalContentFileRefReadContentAsTextAsyncTest()
{
TestEpubContentLoader testEpubContentLoader = new(TEXT_FILE_CONTENT);
EpubLocalTextContentFileRef epubLocalTextContentFileRef = new(LocalTextFileRefMetadata, LOCAL_TEXT_FILE_PATH, testEpubContentLoader);
Expand All @@ -199,7 +199,7 @@ public void LocalContentFileRefReadContentAsBytesTest()
}

[Fact(DisplayName = "Reading local content file as bytes asynchronously should succeed")]
public async void LocalContentFileRefReadContentAsBytesAsyncTest()
public async Task LocalContentFileRefReadContentAsBytesAsyncTest()
{
TestEpubContentLoader testEpubContentLoader = new(BYTE_FILE_CONTENT);
EpubLocalByteContentFileRef epubLocalByteContentFileRef = new(LocalByteFileRefMetadata, LOCAL_BYTE_FILE_PATH, testEpubContentLoader);
Expand All @@ -218,7 +218,7 @@ public void LocalContentFileRefGetContentStreamTest()
}

[Fact(DisplayName = "Getting local content file stream asynchronously should succeed")]
public async void LocalContentFileRefGetContentStreamAsyncTest()
public async Task LocalContentFileRefGetContentStreamAsyncTest()
{
using MemoryStream testStream = new();
TestEpubContentLoader testEpubContentLoader = new(testStream);
Expand All @@ -237,7 +237,7 @@ public void RemoteTextContentFileRefDownloadContentTest()
}

[Fact(DisplayName = "Downloading remote text content file asynchronously should succeed")]
public async void RemoteTextContentFileRefDownloadContentAsyncTest()
public async Task RemoteTextContentFileRefDownloadContentAsyncTest()
{
TestEpubContentLoader testEpubContentLoader = new(TEXT_FILE_CONTENT);
EpubRemoteTextContentFileRef epubRemoteTextContentFileRef = new(RemoteTextFileRefMetadata, testEpubContentLoader);
Expand All @@ -255,7 +255,7 @@ public void RemoteByteContentFileRefDownloadContentTest()
}

[Fact(DisplayName = "Downloading remote byte content file asynchronously should succeed")]
public async void RemoteByteContentFileRefDownloadContentAsyncTest()
public async Task RemoteByteContentFileRefDownloadContentAsyncTest()
{
TestEpubContentLoader testEpubContentLoader = new(BYTE_FILE_CONTENT);
EpubRemoteByteContentFileRef epubRemoteByteContentFileRef = new(RemoteByteFileRefMetadata, testEpubContentLoader);
Expand All @@ -273,7 +273,7 @@ public void RemoteContentFileRefDownloadContentAsTextTest()
}

[Fact(DisplayName = "Downloading remote content file as text asynchronously should succeed")]
public async void RemoteContentFileRefDownloadContentAsTextAsyncTest()
public async Task RemoteContentFileRefDownloadContentAsTextAsyncTest()
{
TestEpubContentLoader testEpubContentLoader = new(TEXT_FILE_CONTENT);
EpubRemoteTextContentFileRef epubRemoteTextContentFileRef = new(RemoteTextFileRefMetadata, testEpubContentLoader);
Expand All @@ -291,7 +291,7 @@ public void RemoteContentFileRefDownloadContentAsBytesTest()
}

[Fact(DisplayName = "Downloading remote content file as bytes asynchronously should succeed")]
public async void RemoteContentFileRefDownloadContentAsBytesAsyncTest()
public async Task RemoteContentFileRefDownloadContentAsBytesAsyncTest()
{
TestEpubContentLoader testEpubContentLoader = new(BYTE_FILE_CONTENT);
EpubRemoteByteContentFileRef epubRemoteByteContentFileRef = new(RemoteByteFileRefMetadata, testEpubContentLoader);
Expand All @@ -310,7 +310,7 @@ public void RemoteContentFileRefGetDownloadingContentStreamTest()
}

[Fact(DisplayName = "Getting remote content file stream asynchronously should succeed")]
public async void RemoteContentFileRefGetDownloadingContentStreamAsyncTest()
public async Task RemoteContentFileRefGetDownloadingContentStreamAsyncTest()
{
MemoryStream testStream = new();
TestEpubContentLoader testEpubContentLoader = new(testStream);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ public void LoadContentAsTextTest()
}

[Fact(DisplayName = "Loading content of an existing text file asynchronously should succeed")]
public async void LoadContentAsTextAsyncTest()
public async Task LoadContentAsTextAsyncTest()
{
TestZipFile testZipFile = new();
testZipFile.AddEntry(TEXT_FILE_PATH, TEXT_FILE_CONTENT);
Expand All @@ -85,7 +85,7 @@ public void LoadContentAsBytesTest()
}

[Fact(DisplayName = "Loading content of an existing byte file asynchronously should succeed")]
public async void LoadContentAsBytesAsyncTest()
public async Task LoadContentAsBytesAsyncTest()
{
TestZipFile testZipFile = new();
testZipFile.AddEntry(BYTE_FILE_PATH, BYTE_FILE_CONTENT);
Expand All @@ -106,7 +106,7 @@ public void GetContentStreamTest()
}

[Fact(DisplayName = "Getting content stream of an existing file asynchronously should succeed")]
public async void GetContentStreamAsyncTest()
public async Task GetContentStreamAsyncTest()
{
TestZipFile testZipFile = new();
using MemoryStream testContentStream = new();
Expand Down Expand Up @@ -138,7 +138,7 @@ public void LoadContentAsTextWithMissingFileTest()
}

[Fact(DisplayName = "LoadContentAsTextAsync should throw EpubContentException if the file is missing in the EPUB archive")]
public async void LoadContentAsTextAsyncWithMissingFileTest()
public async Task LoadContentAsTextAsyncWithMissingFileTest()
{
TestZipFile testZipFile = new();
EpubLocalContentLoader epubLocalContentLoader = CreateEpubLocalContentLoader(testZipFile);
Expand All @@ -154,7 +154,7 @@ public void LoadContentAsBytesWithMissingFileTest()
}

[Fact(DisplayName = "LoadContentAsBytesAsync should throw EpubContentException if the file is missing in the EPUB archive")]
public async void LoadContentAsBytesAsyncWithMissingFileTest()
public async Task LoadContentAsBytesAsyncWithMissingFileTest()
{
TestZipFile testZipFile = new();
EpubLocalContentLoader epubLocalContentLoader = CreateEpubLocalContentLoader(testZipFile);
Expand All @@ -170,7 +170,7 @@ public void GetContentStreamWithMissingFileTest()
}

[Fact(DisplayName = "GetContentStreamAsync should throw EpubContentException if the file is missing in the EPUB archive")]
public async void GetContentStreamAsyncWithMissingFileTest()
public async Task GetContentStreamAsyncWithMissingFileTest()
{
TestZipFile testZipFile = new();
EpubLocalContentLoader epubLocalContentLoader = CreateEpubLocalContentLoader(testZipFile);
Expand All @@ -187,7 +187,7 @@ public void LoadContentAsTextWithLargeFileTest()
}

[Fact(DisplayName = "LoadContentAsTextAsync should throw EpubContentException if the file is larger than 2 GB")]
public async void LoadContentAsTextAsyncWithLargeFileTest()
public async Task LoadContentAsTextAsyncWithLargeFileTest()
{
TestZipFile testZipFile = new();
testZipFile.AddEntry(TEXT_FILE_PATH, new Test4GbZipFileEntry());
Expand All @@ -205,7 +205,7 @@ public void LoadContentAsBytesWithLargeFileTest()
}

[Fact(DisplayName = "LoadContentAsBytesAsync should throw EpubContentException if the file is larger than 2 GB")]
public async void LoadContentAsBytesAsyncWithLargeFileTest()
public async Task LoadContentAsBytesAsyncWithLargeFileTest()
{
TestZipFile testZipFile = new();
testZipFile.AddEntry(BYTE_FILE_PATH, new Test4GbZipFileEntry());
Expand All @@ -223,7 +223,7 @@ public void GetContentStreamWithLargeFileTest()
}

[Fact(DisplayName = "GetContentStreamAsync should throw EpubContentException if the file is larger than 2 GB")]
public async void GetContentStreamAsyncWithLargeFileTest()
public async Task GetContentStreamAsyncWithLargeFileTest()
{
TestZipFile testZipFile = new();
testZipFile.AddEntry(TEXT_FILE_PATH, new Test4GbZipFileEntry());
Expand All @@ -241,7 +241,7 @@ public void LoadContentAsTextWithDisposedEpubFileTest()
}

[Fact(DisplayName = "LoadContentAsTextAsync should throw ObjectDisposedException if the EPUB file is disposed")]
public async void LoadContentAsTextAsyncWithDisposedEpubFileTest()
public async Task LoadContentAsTextAsyncWithDisposedEpubFileTest()
{
TestZipFile testZipFile = new();
testZipFile.Dispose();
Expand All @@ -259,7 +259,7 @@ public void LoadContentAsBytesWithDisposedEpubFileTest()
}

[Fact(DisplayName = "LoadContentAsBytesAsync should throw ObjectDisposedException if the EPUB file is disposed")]
public async void LoadContentAsBytesAsyncWithDisposedEpubFileTest()
public async Task LoadContentAsBytesAsyncWithDisposedEpubFileTest()
{
TestZipFile testZipFile = new();
testZipFile.Dispose();
Expand All @@ -277,7 +277,7 @@ public void GetContentStreamWithDisposedEpubFileTest()
}

[Fact(DisplayName = "GetContentStreamAsync should throw ObjectDisposedException if the EPUB file is disposed")]
public async void GetContentStreamAsyncWithDisposedEpubFileTest()
public async Task GetContentStreamAsyncWithDisposedEpubFileTest()
{
TestZipFile testZipFile = new();
testZipFile.Dispose();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ public void LoadContentAsTextTest()
}

[Fact(DisplayName = "Loading text file content asynchronously should succeed")]
public async void LoadContentAsTextAsyncTest()
public async Task LoadContentAsTextAsyncTest()
{
TestContentDownloader testContentDownloader = new(TEXT_FILE_HREF, TEXT_FILE_CONTENT);
EpubRemoteContentLoader epubRemoteContentLoader = CreateEpubRemoteContentLoader(testContentDownloader);
Expand All @@ -67,7 +67,7 @@ public void LoadContentAsBytesTest()
}

[Fact(DisplayName = "Loading byte file content asynchronously should succeed")]
public async void LoadContentAsBytesAsyncTest()
public async Task LoadContentAsBytesAsyncTest()
{
TestContentDownloader testContentDownloader = new(BYTE_FILE_HREF, BYTE_FILE_CONTENT);
EpubRemoteContentLoader epubRemoteContentLoader = CreateEpubRemoteContentLoader(testContentDownloader);
Expand All @@ -86,7 +86,7 @@ public void GetContentStreamTest()
}

[Fact(DisplayName = "Getting file content stream asynchronously should succeed")]
public async void GetContentStreamAsyncTest()
public async Task GetContentStreamAsyncTest()
{
using MemoryStream testContentStream = new();
TestContentDownloader testContentDownloader = new(TEXT_FILE_HREF, testContentStream);
Expand Down Expand Up @@ -120,7 +120,7 @@ public void LoadContentAsTextWithDownloadContentFalseTest()
}

[Fact(DisplayName = "LoadContentAsTextAsync should throw EpubContentDownloaderException if ContentDownloaderOptions.DownloadContent is false")]
public async void LoadContentAsTextAsyncWithDownloadContentFalseTest()
public async Task LoadContentAsTextAsyncWithDownloadContentFalseTest()
{
ContentDownloaderOptions contentDownloaderOptions = new()
{
Expand All @@ -142,7 +142,7 @@ public void LoadContentAsBytesWithDownloadContentFalseTest()
}

[Fact(DisplayName = "LoadContentAsBytesAsync should throw EpubContentDownloaderException if ContentDownloaderOptions.DownloadContent is false")]
public async void LoadContentAsBytesAsyncWithDownloadContentFalseTest()
public async Task LoadContentAsBytesAsyncWithDownloadContentFalseTest()
{
ContentDownloaderOptions contentDownloaderOptions = new()
{
Expand All @@ -164,7 +164,7 @@ public void GetContentStreamWithDownloadContentFalseTest()
}

[Fact(DisplayName = "GetContentStreamAsync should throw EpubContentDownloaderException if ContentDownloaderOptions.DownloadContent is false")]
public async void GetContentStreamAsyncWithDownloadContentFalseTest()
public async Task GetContentStreamAsyncWithDownloadContentFalseTest()
{
ContentDownloaderOptions contentDownloaderOptions = new()
{
Expand Down
Loading

0 comments on commit 50c6684

Please sign in to comment.