mirror of
https://github.com/BinaryAlley/Nemera.git
synced 2026-12-03 09:11:10 +00:00
Formats code comments as sentences in the tests.
Capitalizes the first word and adds the terminal period in the unit, integration and security tests. The AAA markers stay bare, the TODO bodies stay lowercase, and no assertion, payload, expected status code or test signature changes.
This commit is contained in:
1 parent
727aa33318
commit
057f557791
540 files changed
+3888
-3888
No files matched your search
+17
-17
@@ -27,9 +27,9 @@ public class TranscodingCachePathsTests : IDisposable
|
||||
}
|
||||
|
||||
[Theory]
|
||||
[InlineData(null)] // no cache directory is configured
|
||||
[InlineData("")] // an empty cache directory is configured
|
||||
[InlineData(" ")] // a white space cache directory is configured
|
||||
[InlineData(null)] // No cache directory is configured.
|
||||
[InlineData("")] // An empty cache directory is configured.
|
||||
[InlineData(" ")] // A white space cache directory is configured.
|
||||
public void GetRootDirectory_WhenNoDirectoryIsConfigured_ShouldReturnTheDefaultDirectoryUnderTheTemporaryDirectory(string? configuredDirectory)
|
||||
{
|
||||
// Act
|
||||
@@ -128,13 +128,13 @@ public class TranscodingCachePathsTests : IDisposable
|
||||
}
|
||||
|
||||
[Theory]
|
||||
[InlineData(null)] // no identifier
|
||||
[InlineData("")] // an empty identifier
|
||||
[InlineData("0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcde")] // 63 characters
|
||||
[InlineData("0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0")] // 65 characters
|
||||
[InlineData("0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF")] // uppercase hexadecimal characters
|
||||
[InlineData("0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdeg")] // a character that is not hexadecimal
|
||||
[InlineData("0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcde/")] // a directory separator
|
||||
[InlineData(null)] // No identifier.
|
||||
[InlineData("")] // An empty identifier.
|
||||
[InlineData("0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcde")] // 63 characters.
|
||||
[InlineData("0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0")] // 65 characters.
|
||||
[InlineData("0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF")] // Uppercase hexadecimal characters.
|
||||
[InlineData("0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdeg")] // A character that is not hexadecimal.
|
||||
[InlineData("0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcde/")] // A directory separator.
|
||||
public void IsValidCacheId_WhenTheValueIsNotAWellFormedIdentifier_ShouldReturnFalse(string? cacheId)
|
||||
{
|
||||
// Act
|
||||
@@ -158,10 +158,10 @@ public class TranscodingCachePathsTests : IDisposable
|
||||
}
|
||||
|
||||
[Theory]
|
||||
[InlineData(null)] // no name
|
||||
[InlineData("")] // an empty name
|
||||
[InlineData("segment.m4s")] // an ordinary file name
|
||||
[InlineData("not-a-cache-entry")] // an ordinary directory name
|
||||
[InlineData(null)] // No name.
|
||||
[InlineData("")] // An empty name.
|
||||
[InlineData("segment.m4s")] // An ordinary file name.
|
||||
[InlineData("not-a-cache-entry")] // An ordinary directory name.
|
||||
public void IsCacheEntryName_WhenTheNameIsNotInTheCacheNamespace_ShouldReturnFalse(string? entryName)
|
||||
{
|
||||
// Act
|
||||
@@ -172,9 +172,9 @@ public class TranscodingCachePathsTests : IDisposable
|
||||
}
|
||||
|
||||
[Theory]
|
||||
[InlineData("0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef")] // a cache identifier
|
||||
[InlineData("tmp-0123456789abcdef")] // a temporary directory
|
||||
[InlineData("del-0123456789abcdef")] // a deletion tombstone
|
||||
[InlineData("0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef")] // A cache identifier.
|
||||
[InlineData("tmp-0123456789abcdef")] // A temporary directory.
|
||||
[InlineData("del-0123456789abcdef")] // A deletion tombstone.
|
||||
public void IsCacheEntryName_WhenTheNameIsInTheCacheNamespace_ShouldReturnTrue(string entryName)
|
||||
{
|
||||
// Act
|
||||
|
||||
+10
-10
@@ -119,13 +119,13 @@ public class MusicArtworkServiceTests
|
||||
}
|
||||
|
||||
[Theory]
|
||||
[InlineData(ArtworkType.Cover, 0, "cover.jpg")] // the front cover uses the bare type name
|
||||
[InlineData(ArtworkType.Back, 0, "back.jpg")] // the back cover uses the bare type name
|
||||
[InlineData(ArtworkType.Medium, 0, "medium.jpg")] // a single medium uses the bare type name
|
||||
[InlineData(ArtworkType.Booklet, 0, "booklet.jpg")] // the first booklet page uses the bare type name
|
||||
[InlineData(ArtworkType.Booklet, 2, "booklet-2.jpg")] // a further booklet page is suffixed with its ordinal
|
||||
[InlineData(ArtworkType.Liner, 1, "liner-1.jpg")] // a liner note page is suffixed with its ordinal
|
||||
[InlineData(ArtworkType.Other, 0, "other.jpg")] // any other type falls back to the generic name
|
||||
[InlineData(ArtworkType.Cover, 0, "cover.jpg")] // The front cover uses the bare type name.
|
||||
[InlineData(ArtworkType.Back, 0, "back.jpg")] // The back cover uses the bare type name.
|
||||
[InlineData(ArtworkType.Medium, 0, "medium.jpg")] // A single medium uses the bare type name.
|
||||
[InlineData(ArtworkType.Booklet, 0, "booklet.jpg")] // The first booklet page uses the bare type name.
|
||||
[InlineData(ArtworkType.Booklet, 2, "booklet-2.jpg")] // A further booklet page is suffixed with its ordinal.
|
||||
[InlineData(ArtworkType.Liner, 1, "liner-1.jpg")] // A liner note page is suffixed with its ordinal.
|
||||
[InlineData(ArtworkType.Other, 0, "other.jpg")] // Any other type falls back to the generic name.
|
||||
public async Task SaveAlbumArtworkAsync_WhenTheArtworkHasAType_ShouldNameTheFileAfterTheTypeAndOrdinal(ArtworkType artworkType, int ordinal, string expectedFileName)
|
||||
{
|
||||
// Arrange
|
||||
@@ -833,9 +833,9 @@ public class MusicArtworkServiceTests
|
||||
}
|
||||
|
||||
[Theory]
|
||||
[InlineData(null)] // a null path is a no-op
|
||||
[InlineData("")] // an empty path is a no-op
|
||||
[InlineData(" ")] // a whitespace path is a no-op
|
||||
[InlineData(null)] // A null path is a no-op.
|
||||
[InlineData("")] // An empty path is a no-op.
|
||||
[InlineData(" ")] // A whitespace path is a no-op.
|
||||
public void DeleteStoredArtwork_WhenThePathIsMissing_ShouldReturnDeletedWithoutTouchingTheFileSystem(string? artworkRelativePath)
|
||||
{
|
||||
// Act
|
||||
|
||||
+4
-4
@@ -111,8 +111,8 @@ public class TranscodingCacheCoordinatorTests : IDisposable
|
||||
}
|
||||
|
||||
[Theory]
|
||||
[InlineData(0)] // a zero sized output
|
||||
[InlineData(-1)] // a negative sized output
|
||||
[InlineData(0)] // A zero sized output.
|
||||
[InlineData(-1)] // A negative sized output.
|
||||
public void TryReserve_WhenTheRequestedSizeIsNotPositive_ShouldReturnFalse(int requestedBytes)
|
||||
{
|
||||
// Act
|
||||
@@ -124,8 +124,8 @@ public class TranscodingCacheCoordinatorTests : IDisposable
|
||||
}
|
||||
|
||||
[Theory]
|
||||
[InlineData(0)] // a zero maximum cache size
|
||||
[InlineData(-1)] // a negative maximum cache size
|
||||
[InlineData(0)] // A zero maximum cache size.
|
||||
[InlineData(-1)] // A negative maximum cache size.
|
||||
public void TryReserve_WhenTheMaximumCacheSizeIsNotPositive_ShouldReturnFalse(int maxCacheBytes)
|
||||
{
|
||||
// Act
|
||||
|
||||
+4
-4
@@ -107,7 +107,7 @@ public class ThemeServiceTests : IDisposable
|
||||
public void HasThemePack_WhenThemeIsNotInstalled_ShouldReturnFalse()
|
||||
{
|
||||
// Arrange
|
||||
// nothing is installed
|
||||
// Nothing is installed.
|
||||
|
||||
// Act
|
||||
bool result = _sut.HasThemePack("test-theme");
|
||||
@@ -878,9 +878,9 @@ public class ThemeServiceTests : IDisposable
|
||||
}
|
||||
|
||||
[Theory]
|
||||
[InlineData("../secret")] // parent scope traversal attempt
|
||||
[InlineData("/etc/passwd")] // rooted path attempt
|
||||
[InlineData("templates//nested")] // empty segment attempt
|
||||
[InlineData("../secret")] // Parent scope traversal attempt.
|
||||
[InlineData("/etc/passwd")] // Rooted path attempt.
|
||||
[InlineData("templates//nested")] // Empty segment attempt.
|
||||
public async Task GetTemplateAsync_WhenPageKeyAttemptsToEscapeTheThemePack_ShouldReturnThemeTemplateNotFound(string pageKey)
|
||||
{
|
||||
// Arrange
|
||||
|
||||
Reference in new issue
Block a user