mirror of
https://github.com/BinaryAlley/Nemera.git
synced 2026-12-03 06: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
+37
-37
@@ -44,11 +44,11 @@ public class AddAlbumCommandValidatorTests
|
||||
private readonly IsrcDtoFixture _isrcDtoFixture = new();
|
||||
|
||||
[Theory]
|
||||
[InlineData(null)] // missing route value
|
||||
[InlineData("")] // empty route value
|
||||
[InlineData(" ")] // whitespace route value, which both the not empty rule and the format rule reject
|
||||
[InlineData("not-a-library-guid")] // non-Guid route value
|
||||
[InlineData("00000000-0000-0000-0000-000000000000")] // empty Guid route value
|
||||
[InlineData(null)] // Missing route value.
|
||||
[InlineData("")] // Empty route value.
|
||||
[InlineData(" ")] // Whitespace route value, which both the not empty rule and the format rule reject.
|
||||
[InlineData("not-a-library-guid")] // Non-Guid route value.
|
||||
[InlineData("00000000-0000-0000-0000-000000000000")] // Empty Guid route value.
|
||||
public void Validate_WhenLibraryIdIsEmptyOrInvalid_ShouldHaveValidationError(string? libraryId)
|
||||
{
|
||||
// Arrange
|
||||
@@ -62,11 +62,11 @@ public class AddAlbumCommandValidatorTests
|
||||
}
|
||||
|
||||
[Theory]
|
||||
[InlineData(null)] // missing route value
|
||||
[InlineData("")] // empty route value
|
||||
[InlineData(" ")] // whitespace route value, which both the not empty rule and the format rule reject
|
||||
[InlineData("not-an-artist-guid")] // non-Guid route value
|
||||
[InlineData("00000000-0000-0000-0000-000000000000")] // empty Guid route value
|
||||
[InlineData(null)] // Missing route value.
|
||||
[InlineData("")] // Empty route value.
|
||||
[InlineData(" ")] // Whitespace route value, which both the not empty rule and the format rule reject.
|
||||
[InlineData("not-an-artist-guid")] // Non-Guid route value.
|
||||
[InlineData("00000000-0000-0000-0000-000000000000")] // Empty Guid route value.
|
||||
public void Validate_WhenArtistIdIsEmptyOrInvalid_ShouldHaveValidationError(string? artistId)
|
||||
{
|
||||
// Arrange
|
||||
@@ -106,8 +106,8 @@ public class AddAlbumCommandValidatorTests
|
||||
}
|
||||
|
||||
[Theory]
|
||||
[InlineData("")] // empty title
|
||||
[InlineData(" ")] // whitespace title, which the not empty rule rejects
|
||||
[InlineData("")] // Empty title.
|
||||
[InlineData(" ")] // Whitespace title, which the not empty rule rejects.
|
||||
public void Validate_WhenTitleIsEmpty_ShouldHaveValidationError(string title)
|
||||
{
|
||||
// Arrange
|
||||
@@ -304,8 +304,8 @@ public class AddAlbumCommandValidatorTests
|
||||
}
|
||||
|
||||
[Theory]
|
||||
[InlineData(0)] // zero is not a valid total discs value
|
||||
[InlineData(-1)] // a negative total discs value is not valid
|
||||
[InlineData(0)] // Zero is not a valid total discs value.
|
||||
[InlineData(-1)] // A negative total discs value is not valid.
|
||||
public void Validate_WhenTotalDiscsIsNotPositive_ShouldHaveValidationError(int totalDiscs)
|
||||
{
|
||||
// Arrange
|
||||
@@ -345,8 +345,8 @@ public class AddAlbumCommandValidatorTests
|
||||
}
|
||||
|
||||
[Theory]
|
||||
[InlineData(0)] // zero is not a valid total tracks value
|
||||
[InlineData(-1)] // a negative total tracks value is not valid
|
||||
[InlineData(0)] // Zero is not a valid total tracks value.
|
||||
[InlineData(-1)] // A negative total tracks value is not valid.
|
||||
public void Validate_WhenTotalTracksIsNotPositive_ShouldHaveValidationError(int totalTracks)
|
||||
{
|
||||
// Arrange
|
||||
@@ -1001,9 +1001,9 @@ public class AddAlbumCommandValidatorTests
|
||||
}
|
||||
|
||||
[Theory]
|
||||
[InlineData("123")] // too short to be a barcode
|
||||
[InlineData("abcdefghijkl")] // not numeric
|
||||
[InlineData("12345678901234")] // too long to be a barcode
|
||||
[InlineData("123")] // Too short to be a barcode.
|
||||
[InlineData("abcdefghijkl")] // Not numeric.
|
||||
[InlineData("12345678901234")] // Too long to be a barcode.
|
||||
public void Validate_WhenBarcodeHasInvalidFormat_ShouldHaveValidationError(string barcode)
|
||||
{
|
||||
// Arrange
|
||||
@@ -1017,8 +1017,8 @@ public class AddAlbumCommandValidatorTests
|
||||
}
|
||||
|
||||
[Theory]
|
||||
[InlineData("123456789012")] // 12 digit barcode
|
||||
[InlineData("1234567890123")] // 13 digit barcode
|
||||
[InlineData("123456789012")] // 12 digit barcode.
|
||||
[InlineData("1234567890123")] // 13 digit barcode.
|
||||
public void Validate_WhenBarcodeIsValid_ShouldNotHaveValidationError(string barcode)
|
||||
{
|
||||
// Arrange
|
||||
@@ -1181,8 +1181,8 @@ public class AddAlbumCommandValidatorTests
|
||||
}
|
||||
|
||||
[Theory]
|
||||
[InlineData(0)] // zero is not a valid rating value
|
||||
[InlineData(-1)] // a negative rating value is not valid
|
||||
[InlineData(0)] // Zero is not a valid rating value.
|
||||
[InlineData(-1)] // A negative rating value is not valid.
|
||||
public void Validate_WhenRatingValueIsNotPositive_ShouldHaveValidationError(decimal value)
|
||||
{
|
||||
// Arrange
|
||||
@@ -1222,8 +1222,8 @@ public class AddAlbumCommandValidatorTests
|
||||
}
|
||||
|
||||
[Theory]
|
||||
[InlineData(0)] // zero is not a valid maximum rating value
|
||||
[InlineData(-1)] // a negative maximum rating value is not valid
|
||||
[InlineData(0)] // Zero is not a valid maximum rating value.
|
||||
[InlineData(-1)] // A negative maximum rating value is not valid.
|
||||
public void Validate_WhenRatingMaxValueIsNotPositive_ShouldHaveValidationError(decimal maxValue)
|
||||
{
|
||||
// Arrange
|
||||
@@ -1319,8 +1319,8 @@ public class AddAlbumCommandValidatorTests
|
||||
}
|
||||
|
||||
[Theory]
|
||||
[InlineData("")] // empty path
|
||||
[InlineData(" ")] // whitespace path, which the not empty rule rejects
|
||||
[InlineData("")] // Empty path.
|
||||
[InlineData(" ")] // Whitespace path, which the not empty rule rejects.
|
||||
public void Validate_WhenTrackPathIsEmpty_ShouldHaveValidationError(string path)
|
||||
{
|
||||
// Arrange
|
||||
@@ -1817,8 +1817,8 @@ public class AddAlbumCommandValidatorTests
|
||||
}
|
||||
|
||||
[Theory]
|
||||
[InlineData(0)] // zero is not a valid track number
|
||||
[InlineData(-1)] // a negative track number is not valid
|
||||
[InlineData(0)] // Zero is not a valid track number.
|
||||
[InlineData(-1)] // A negative track number is not valid.
|
||||
public void Validate_WhenTrackNumberIsNotPositive_ShouldHaveValidationError(int trackNumber)
|
||||
{
|
||||
// Arrange
|
||||
@@ -1845,8 +1845,8 @@ public class AddAlbumCommandValidatorTests
|
||||
}
|
||||
|
||||
[Theory]
|
||||
[InlineData(0)] // zero is not a valid disc number
|
||||
[InlineData(-1)] // a negative disc number is not valid
|
||||
[InlineData(0)] // Zero is not a valid disc number.
|
||||
[InlineData(-1)] // A negative disc number is not valid.
|
||||
public void Validate_WhenDiscNumberIsNotPositive_ShouldHaveValidationError(int discNumber)
|
||||
{
|
||||
// Arrange
|
||||
@@ -1964,8 +1964,8 @@ public class AddAlbumCommandValidatorTests
|
||||
}
|
||||
|
||||
[Theory]
|
||||
[InlineData(0)] // zero is not a valid tempo
|
||||
[InlineData(-1)] // a negative tempo is not valid
|
||||
[InlineData(0)] // Zero is not a valid tempo.
|
||||
[InlineData(-1)] // A negative tempo is not valid.
|
||||
public void Validate_WhenBpmIsNotPositive_ShouldHaveValidationError(int bpm)
|
||||
{
|
||||
// Arrange
|
||||
@@ -2148,8 +2148,8 @@ public class AddAlbumCommandValidatorTests
|
||||
}
|
||||
|
||||
[Theory]
|
||||
[InlineData(0)] // zero is not a valid rating value
|
||||
[InlineData(-1)] // a negative rating value is not valid
|
||||
[InlineData(0)] // Zero is not a valid rating value.
|
||||
[InlineData(-1)] // A negative rating value is not valid.
|
||||
public void Validate_WhenTrackRatingValueIsNotPositive_ShouldHaveValidationError(decimal value)
|
||||
{
|
||||
// Arrange
|
||||
@@ -2176,8 +2176,8 @@ public class AddAlbumCommandValidatorTests
|
||||
}
|
||||
|
||||
[Theory]
|
||||
[InlineData(0)] // zero is not a valid maximum rating value
|
||||
[InlineData(-1)] // a negative maximum rating value is not valid
|
||||
[InlineData(0)] // Zero is not a valid maximum rating value.
|
||||
[InlineData(-1)] // A negative maximum rating value is not valid.
|
||||
public void Validate_WhenTrackRatingMaxValueIsNotPositive_ShouldHaveValidationError(decimal maxValue)
|
||||
{
|
||||
// Arrange
|
||||
|
||||
+15
-15
@@ -21,11 +21,11 @@ public class DeleteAlbumCommandValidatorTests
|
||||
private readonly DeleteAlbumCommandValidator _validator = new();
|
||||
|
||||
[Theory]
|
||||
[InlineData(null)] // missing route value
|
||||
[InlineData("")] // empty route value
|
||||
[InlineData(" ")] // whitespace route value, which both the not empty rule and the format rule reject
|
||||
[InlineData("not-a-library-guid")] // non-Guid route value
|
||||
[InlineData("00000000-0000-0000-0000-000000000000")] // empty Guid route value
|
||||
[InlineData(null)] // Missing route value.
|
||||
[InlineData("")] // Empty route value.
|
||||
[InlineData(" ")] // Whitespace route value, which both the not empty rule and the format rule reject.
|
||||
[InlineData("not-a-library-guid")] // Non-Guid route value.
|
||||
[InlineData("00000000-0000-0000-0000-000000000000")] // Empty Guid route value.
|
||||
public void Validate_WhenLibraryIdIsEmptyOrInvalid_ShouldHaveValidationError(string? libraryId)
|
||||
{
|
||||
// Arrange
|
||||
@@ -39,11 +39,11 @@ public class DeleteAlbumCommandValidatorTests
|
||||
}
|
||||
|
||||
[Theory]
|
||||
[InlineData(null)] // missing route value
|
||||
[InlineData("")] // empty route value
|
||||
[InlineData(" ")] // whitespace route value, which both the not empty rule and the format rule reject
|
||||
[InlineData("not-an-artist-guid")] // non-Guid route value
|
||||
[InlineData("00000000-0000-0000-0000-000000000000")] // empty Guid route value
|
||||
[InlineData(null)] // Missing route value.
|
||||
[InlineData("")] // Empty route value.
|
||||
[InlineData(" ")] // Whitespace route value, which both the not empty rule and the format rule reject.
|
||||
[InlineData("not-an-artist-guid")] // Non-Guid route value.
|
||||
[InlineData("00000000-0000-0000-0000-000000000000")] // Empty Guid route value.
|
||||
public void Validate_WhenArtistIdIsEmptyOrInvalid_ShouldHaveValidationError(string? artistId)
|
||||
{
|
||||
// Arrange
|
||||
@@ -57,11 +57,11 @@ public class DeleteAlbumCommandValidatorTests
|
||||
}
|
||||
|
||||
[Theory]
|
||||
[InlineData(null)] // missing route value
|
||||
[InlineData("")] // empty route value
|
||||
[InlineData(" ")] // whitespace route value, which both the not empty rule and the format rule reject
|
||||
[InlineData("not-an-album-guid")] // non-Guid route value
|
||||
[InlineData("00000000-0000-0000-0000-000000000000")] // empty Guid route value
|
||||
[InlineData(null)] // Missing route value.
|
||||
[InlineData("")] // Empty route value.
|
||||
[InlineData(" ")] // Whitespace route value, which both the not empty rule and the format rule reject.
|
||||
[InlineData("not-an-album-guid")] // Non-Guid route value.
|
||||
[InlineData("00000000-0000-0000-0000-000000000000")] // Empty Guid route value.
|
||||
public void Validate_WhenAlbumIdIsEmptyOrInvalid_ShouldHaveValidationError(string? albumId)
|
||||
{
|
||||
// Arrange
|
||||
|
||||
+15
-15
@@ -21,11 +21,11 @@ public class RestoreAlbumCommandValidatorTests
|
||||
private readonly RestoreAlbumCommandValidator _validator = new();
|
||||
|
||||
[Theory]
|
||||
[InlineData(null)] // missing route value
|
||||
[InlineData("")] // empty route value
|
||||
[InlineData(" ")] // whitespace route value, which both the not empty rule and the format rule reject
|
||||
[InlineData("not-a-library-guid")] // non-Guid route value
|
||||
[InlineData("00000000-0000-0000-0000-000000000000")] // empty Guid route value
|
||||
[InlineData(null)] // Missing route value.
|
||||
[InlineData("")] // Empty route value.
|
||||
[InlineData(" ")] // Whitespace route value, which both the not empty rule and the format rule reject.
|
||||
[InlineData("not-a-library-guid")] // Non-Guid route value.
|
||||
[InlineData("00000000-0000-0000-0000-000000000000")] // Empty Guid route value.
|
||||
public void Validate_WhenLibraryIdIsEmptyOrInvalid_ShouldHaveValidationError(string? libraryId)
|
||||
{
|
||||
// Arrange
|
||||
@@ -39,11 +39,11 @@ public class RestoreAlbumCommandValidatorTests
|
||||
}
|
||||
|
||||
[Theory]
|
||||
[InlineData(null)] // missing route value
|
||||
[InlineData("")] // empty route value
|
||||
[InlineData(" ")] // whitespace route value, which both the not empty rule and the format rule reject
|
||||
[InlineData("not-an-artist-guid")] // non-Guid route value
|
||||
[InlineData("00000000-0000-0000-0000-000000000000")] // empty Guid route value
|
||||
[InlineData(null)] // Missing route value.
|
||||
[InlineData("")] // Empty route value.
|
||||
[InlineData(" ")] // Whitespace route value, which both the not empty rule and the format rule reject.
|
||||
[InlineData("not-an-artist-guid")] // Non-Guid route value.
|
||||
[InlineData("00000000-0000-0000-0000-000000000000")] // Empty Guid route value.
|
||||
public void Validate_WhenArtistIdIsEmptyOrInvalid_ShouldHaveValidationError(string? artistId)
|
||||
{
|
||||
// Arrange
|
||||
@@ -57,11 +57,11 @@ public class RestoreAlbumCommandValidatorTests
|
||||
}
|
||||
|
||||
[Theory]
|
||||
[InlineData(null)] // missing route value
|
||||
[InlineData("")] // empty route value
|
||||
[InlineData(" ")] // whitespace route value, which both the not empty rule and the format rule reject
|
||||
[InlineData("not-an-album-guid")] // non-Guid route value
|
||||
[InlineData("00000000-0000-0000-0000-000000000000")] // empty Guid route value
|
||||
[InlineData(null)] // Missing route value.
|
||||
[InlineData("")] // Empty route value.
|
||||
[InlineData(" ")] // Whitespace route value, which both the not empty rule and the format rule reject.
|
||||
[InlineData("not-an-album-guid")] // Non-Guid route value.
|
||||
[InlineData("00000000-0000-0000-0000-000000000000")] // Empty Guid route value.
|
||||
public void Validate_WhenAlbumIdIsEmptyOrInvalid_ShouldHaveValidationError(string? albumId)
|
||||
{
|
||||
// Arrange
|
||||
|
||||
+30
-30
@@ -37,11 +37,11 @@ public class UpdateAlbumCommandValidatorTests
|
||||
private readonly AudioRatingDtoFixture _audioRatingDtoFixture = new();
|
||||
|
||||
[Theory]
|
||||
[InlineData(null)] // missing route value
|
||||
[InlineData("")] // empty route value
|
||||
[InlineData(" ")] // whitespace route value, which both the not empty rule and the format rule reject
|
||||
[InlineData("not-a-library-guid")] // non-Guid route value
|
||||
[InlineData("00000000-0000-0000-0000-000000000000")] // empty Guid route value
|
||||
[InlineData(null)] // Missing route value.
|
||||
[InlineData("")] // Empty route value.
|
||||
[InlineData(" ")] // Whitespace route value, which both the not empty rule and the format rule reject.
|
||||
[InlineData("not-a-library-guid")] // Non-Guid route value.
|
||||
[InlineData("00000000-0000-0000-0000-000000000000")] // Empty Guid route value.
|
||||
public void Validate_WhenLibraryIdIsEmptyOrInvalid_ShouldHaveValidationError(string? libraryId)
|
||||
{
|
||||
// Arrange
|
||||
@@ -55,11 +55,11 @@ public class UpdateAlbumCommandValidatorTests
|
||||
}
|
||||
|
||||
[Theory]
|
||||
[InlineData(null)] // missing route value
|
||||
[InlineData("")] // empty route value
|
||||
[InlineData(" ")] // whitespace route value, which both the not empty rule and the format rule reject
|
||||
[InlineData("not-an-artist-guid")] // non-Guid route value
|
||||
[InlineData("00000000-0000-0000-0000-000000000000")] // empty Guid route value
|
||||
[InlineData(null)] // Missing route value.
|
||||
[InlineData("")] // Empty route value.
|
||||
[InlineData(" ")] // Whitespace route value, which both the not empty rule and the format rule reject.
|
||||
[InlineData("not-an-artist-guid")] // Non-Guid route value.
|
||||
[InlineData("00000000-0000-0000-0000-000000000000")] // Empty Guid route value.
|
||||
public void Validate_WhenArtistIdIsEmptyOrInvalid_ShouldHaveValidationError(string? artistId)
|
||||
{
|
||||
// Arrange
|
||||
@@ -73,11 +73,11 @@ public class UpdateAlbumCommandValidatorTests
|
||||
}
|
||||
|
||||
[Theory]
|
||||
[InlineData(null)] // missing route value
|
||||
[InlineData("")] // empty route value
|
||||
[InlineData(" ")] // whitespace route value, which both the not empty rule and the format rule reject
|
||||
[InlineData("not-an-album-guid")] // non-Guid route value
|
||||
[InlineData("00000000-0000-0000-0000-000000000000")] // empty Guid route value
|
||||
[InlineData(null)] // Missing route value.
|
||||
[InlineData("")] // Empty route value.
|
||||
[InlineData(" ")] // Whitespace route value, which both the not empty rule and the format rule reject.
|
||||
[InlineData("not-an-album-guid")] // Non-Guid route value.
|
||||
[InlineData("00000000-0000-0000-0000-000000000000")] // Empty Guid route value.
|
||||
public void Validate_WhenAlbumIdIsEmptyOrInvalid_ShouldHaveValidationError(string? albumId)
|
||||
{
|
||||
// Arrange
|
||||
@@ -117,8 +117,8 @@ public class UpdateAlbumCommandValidatorTests
|
||||
}
|
||||
|
||||
[Theory]
|
||||
[InlineData("")] // empty title
|
||||
[InlineData(" ")] // whitespace title, which the not empty rule rejects
|
||||
[InlineData("")] // Empty title.
|
||||
[InlineData(" ")] // Whitespace title, which the not empty rule rejects.
|
||||
public void Validate_WhenTitleIsEmpty_ShouldHaveValidationError(string title)
|
||||
{
|
||||
// Arrange
|
||||
@@ -315,8 +315,8 @@ public class UpdateAlbumCommandValidatorTests
|
||||
}
|
||||
|
||||
[Theory]
|
||||
[InlineData(0)] // zero is not a valid total discs value
|
||||
[InlineData(-1)] // a negative total discs value is not valid
|
||||
[InlineData(0)] // Zero is not a valid total discs value.
|
||||
[InlineData(-1)] // A negative total discs value is not valid.
|
||||
public void Validate_WhenTotalDiscsIsNotPositive_ShouldHaveValidationError(int totalDiscs)
|
||||
{
|
||||
// Arrange
|
||||
@@ -356,8 +356,8 @@ public class UpdateAlbumCommandValidatorTests
|
||||
}
|
||||
|
||||
[Theory]
|
||||
[InlineData(0)] // zero is not a valid total tracks value
|
||||
[InlineData(-1)] // a negative total tracks value is not valid
|
||||
[InlineData(0)] // Zero is not a valid total tracks value.
|
||||
[InlineData(-1)] // A negative total tracks value is not valid.
|
||||
public void Validate_WhenTotalTracksIsNotPositive_ShouldHaveValidationError(int totalTracks)
|
||||
{
|
||||
// Arrange
|
||||
@@ -1012,9 +1012,9 @@ public class UpdateAlbumCommandValidatorTests
|
||||
}
|
||||
|
||||
[Theory]
|
||||
[InlineData("123")] // too short to be a barcode
|
||||
[InlineData("abcdefghijkl")] // not numeric
|
||||
[InlineData("12345678901234")] // too long to be a barcode
|
||||
[InlineData("123")] // Too short to be a barcode.
|
||||
[InlineData("abcdefghijkl")] // Not numeric.
|
||||
[InlineData("12345678901234")] // Too long to be a barcode.
|
||||
public void Validate_WhenBarcodeHasInvalidFormat_ShouldHaveValidationError(string barcode)
|
||||
{
|
||||
// Arrange
|
||||
@@ -1028,8 +1028,8 @@ public class UpdateAlbumCommandValidatorTests
|
||||
}
|
||||
|
||||
[Theory]
|
||||
[InlineData("123456789012")] // 12 digit barcode
|
||||
[InlineData("1234567890123")] // 13 digit barcode
|
||||
[InlineData("123456789012")] // 12 digit barcode.
|
||||
[InlineData("1234567890123")] // 13 digit barcode.
|
||||
public void Validate_WhenBarcodeIsValid_ShouldNotHaveValidationError(string barcode)
|
||||
{
|
||||
// Arrange
|
||||
@@ -1192,8 +1192,8 @@ public class UpdateAlbumCommandValidatorTests
|
||||
}
|
||||
|
||||
[Theory]
|
||||
[InlineData(0)] // zero is not a valid rating value
|
||||
[InlineData(-1)] // a negative rating value is not valid
|
||||
[InlineData(0)] // Zero is not a valid rating value.
|
||||
[InlineData(-1)] // A negative rating value is not valid.
|
||||
public void Validate_WhenRatingValueIsNotPositive_ShouldHaveValidationError(decimal value)
|
||||
{
|
||||
// Arrange
|
||||
@@ -1233,8 +1233,8 @@ public class UpdateAlbumCommandValidatorTests
|
||||
}
|
||||
|
||||
[Theory]
|
||||
[InlineData(0)] // zero is not a valid maximum rating value
|
||||
[InlineData(-1)] // a negative maximum rating value is not valid
|
||||
[InlineData(0)] // Zero is not a valid maximum rating value.
|
||||
[InlineData(-1)] // A negative maximum rating value is not valid.
|
||||
public void Validate_WhenRatingMaxValueIsNotPositive_ShouldHaveValidationError(decimal maxValue)
|
||||
{
|
||||
// Arrange
|
||||
|
||||
+3
-3
@@ -547,9 +547,9 @@ public class UpdateAlbumCoverCommandHandlerTests
|
||||
}
|
||||
|
||||
[Theory]
|
||||
[InlineData(null)] // no file name at all
|
||||
[InlineData("")] // empty file name
|
||||
[InlineData(" ")] // whitespace file name
|
||||
[InlineData(null)] // No file name at all.
|
||||
[InlineData("")] // Empty file name.
|
||||
[InlineData(" ")] // Whitespace file name.
|
||||
public async Task HandleAsync_WhenExistingCoverPathIsEmpty_ShouldNotDeletePreviousArtwork(string? existingCoverPath)
|
||||
{
|
||||
// Arrange
|
||||
|
||||
+15
-15
@@ -21,11 +21,11 @@ public class GetAlbumQueryValidatorTests
|
||||
private readonly GetAlbumQueryValidator _validator = new();
|
||||
|
||||
[Theory]
|
||||
[InlineData(null)] // missing route value
|
||||
[InlineData("")] // empty route value
|
||||
[InlineData(" ")] // whitespace route value, which both the not empty rule and the format rule reject
|
||||
[InlineData("not-a-library-guid")] // non-Guid route value
|
||||
[InlineData("00000000-0000-0000-0000-000000000000")] // empty Guid route value
|
||||
[InlineData(null)] // Missing route value.
|
||||
[InlineData("")] // Empty route value.
|
||||
[InlineData(" ")] // Whitespace route value, which both the not empty rule and the format rule reject.
|
||||
[InlineData("not-a-library-guid")] // Non-Guid route value.
|
||||
[InlineData("00000000-0000-0000-0000-000000000000")] // Empty Guid route value.
|
||||
public void Validate_WhenLibraryIdIsEmptyOrInvalid_ShouldHaveValidationError(string? libraryId)
|
||||
{
|
||||
// Arrange
|
||||
@@ -39,11 +39,11 @@ public class GetAlbumQueryValidatorTests
|
||||
}
|
||||
|
||||
[Theory]
|
||||
[InlineData(null)] // missing route value
|
||||
[InlineData("")] // empty route value
|
||||
[InlineData(" ")] // whitespace route value, which both the not empty rule and the format rule reject
|
||||
[InlineData("not-an-artist-guid")] // non-Guid route value
|
||||
[InlineData("00000000-0000-0000-0000-000000000000")] // empty Guid route value
|
||||
[InlineData(null)] // Missing route value.
|
||||
[InlineData("")] // Empty route value.
|
||||
[InlineData(" ")] // Whitespace route value, which both the not empty rule and the format rule reject.
|
||||
[InlineData("not-an-artist-guid")] // Non-Guid route value.
|
||||
[InlineData("00000000-0000-0000-0000-000000000000")] // Empty Guid route value.
|
||||
public void Validate_WhenArtistIdIsEmptyOrInvalid_ShouldHaveValidationError(string? artistId)
|
||||
{
|
||||
// Arrange
|
||||
@@ -57,11 +57,11 @@ public class GetAlbumQueryValidatorTests
|
||||
}
|
||||
|
||||
[Theory]
|
||||
[InlineData(null)] // missing route value
|
||||
[InlineData("")] // empty route value
|
||||
[InlineData(" ")] // whitespace route value, which both the not empty rule and the format rule reject
|
||||
[InlineData("not-an-album-guid")] // non-Guid route value
|
||||
[InlineData("00000000-0000-0000-0000-000000000000")] // empty Guid route value
|
||||
[InlineData(null)] // Missing route value.
|
||||
[InlineData("")] // Empty route value.
|
||||
[InlineData(" ")] // Whitespace route value, which both the not empty rule and the format rule reject.
|
||||
[InlineData("not-an-album-guid")] // Non-Guid route value.
|
||||
[InlineData("00000000-0000-0000-0000-000000000000")] // Empty Guid route value.
|
||||
public void Validate_WhenAlbumIdIsEmptyOrInvalid_ShouldHaveValidationError(string? albumId)
|
||||
{
|
||||
// Arrange
|
||||
|
||||
+15
-15
@@ -21,11 +21,11 @@ public class GetAlbumTracksQueryValidatorTests
|
||||
private readonly GetAlbumTracksQueryValidator _validator = new();
|
||||
|
||||
[Theory]
|
||||
[InlineData(null)] // missing route value
|
||||
[InlineData("")] // empty route value
|
||||
[InlineData(" ")] // whitespace route value, which both the not empty rule and the format rule reject
|
||||
[InlineData("not-a-library-guid")] // non-Guid route value
|
||||
[InlineData("00000000-0000-0000-0000-000000000000")] // empty Guid route value
|
||||
[InlineData(null)] // Missing route value.
|
||||
[InlineData("")] // Empty route value.
|
||||
[InlineData(" ")] // Whitespace route value, which both the not empty rule and the format rule reject.
|
||||
[InlineData("not-a-library-guid")] // Non-Guid route value.
|
||||
[InlineData("00000000-0000-0000-0000-000000000000")] // Empty Guid route value.
|
||||
public void Validate_WhenLibraryIdIsEmptyOrInvalid_ShouldHaveValidationError(string? libraryId)
|
||||
{
|
||||
// Arrange
|
||||
@@ -39,11 +39,11 @@ public class GetAlbumTracksQueryValidatorTests
|
||||
}
|
||||
|
||||
[Theory]
|
||||
[InlineData(null)] // missing route value
|
||||
[InlineData("")] // empty route value
|
||||
[InlineData(" ")] // whitespace route value, which both the not empty rule and the format rule reject
|
||||
[InlineData("not-an-artist-guid")] // non-Guid route value
|
||||
[InlineData("00000000-0000-0000-0000-000000000000")] // empty Guid route value
|
||||
[InlineData(null)] // Missing route value.
|
||||
[InlineData("")] // Empty route value.
|
||||
[InlineData(" ")] // Whitespace route value, which both the not empty rule and the format rule reject.
|
||||
[InlineData("not-an-artist-guid")] // Non-Guid route value.
|
||||
[InlineData("00000000-0000-0000-0000-000000000000")] // Empty Guid route value.
|
||||
public void Validate_WhenArtistIdIsEmptyOrInvalid_ShouldHaveValidationError(string? artistId)
|
||||
{
|
||||
// Arrange
|
||||
@@ -57,11 +57,11 @@ public class GetAlbumTracksQueryValidatorTests
|
||||
}
|
||||
|
||||
[Theory]
|
||||
[InlineData(null)] // missing route value
|
||||
[InlineData("")] // empty route value
|
||||
[InlineData(" ")] // whitespace route value, which both the not empty rule and the format rule reject
|
||||
[InlineData("not-an-album-guid")] // non-Guid route value
|
||||
[InlineData("00000000-0000-0000-0000-000000000000")] // empty Guid route value
|
||||
[InlineData(null)] // Missing route value.
|
||||
[InlineData("")] // Empty route value.
|
||||
[InlineData(" ")] // Whitespace route value, which both the not empty rule and the format rule reject.
|
||||
[InlineData("not-an-album-guid")] // Non-Guid route value.
|
||||
[InlineData("00000000-0000-0000-0000-000000000000")] // Empty Guid route value.
|
||||
public void Validate_WhenAlbumIdIsEmptyOrInvalid_ShouldHaveValidationError(string? albumId)
|
||||
{
|
||||
// Arrange
|
||||
|
||||
+15
-15
@@ -21,11 +21,11 @@ public class GetAlbumTracksLiteQueryValidatorTests
|
||||
private readonly GetAlbumTracksLiteQueryValidator _validator = new();
|
||||
|
||||
[Theory]
|
||||
[InlineData(null)] // missing route value
|
||||
[InlineData("")] // empty route value
|
||||
[InlineData(" ")] // whitespace route value, which both the not empty rule and the format rule reject
|
||||
[InlineData("not-a-library-guid")] // non-Guid route value
|
||||
[InlineData("00000000-0000-0000-0000-000000000000")] // empty Guid route value
|
||||
[InlineData(null)] // Missing route value.
|
||||
[InlineData("")] // Empty route value.
|
||||
[InlineData(" ")] // Whitespace route value, which both the not empty rule and the format rule reject.
|
||||
[InlineData("not-a-library-guid")] // Non-Guid route value.
|
||||
[InlineData("00000000-0000-0000-0000-000000000000")] // Empty Guid route value.
|
||||
public void Validate_WhenLibraryIdIsEmptyOrInvalid_ShouldHaveValidationError(string? libraryId)
|
||||
{
|
||||
// Arrange
|
||||
@@ -39,11 +39,11 @@ public class GetAlbumTracksLiteQueryValidatorTests
|
||||
}
|
||||
|
||||
[Theory]
|
||||
[InlineData(null)] // missing route value
|
||||
[InlineData("")] // empty route value
|
||||
[InlineData(" ")] // whitespace route value, which both the not empty rule and the format rule reject
|
||||
[InlineData("not-an-artist-guid")] // non-Guid route value
|
||||
[InlineData("00000000-0000-0000-0000-000000000000")] // empty Guid route value
|
||||
[InlineData(null)] // Missing route value.
|
||||
[InlineData("")] // Empty route value.
|
||||
[InlineData(" ")] // Whitespace route value, which both the not empty rule and the format rule reject.
|
||||
[InlineData("not-an-artist-guid")] // Non-Guid route value.
|
||||
[InlineData("00000000-0000-0000-0000-000000000000")] // Empty Guid route value.
|
||||
public void Validate_WhenArtistIdIsEmptyOrInvalid_ShouldHaveValidationError(string? artistId)
|
||||
{
|
||||
// Arrange
|
||||
@@ -57,11 +57,11 @@ public class GetAlbumTracksLiteQueryValidatorTests
|
||||
}
|
||||
|
||||
[Theory]
|
||||
[InlineData(null)] // missing route value
|
||||
[InlineData("")] // empty route value
|
||||
[InlineData(" ")] // whitespace route value, which both the not empty rule and the format rule reject
|
||||
[InlineData("not-an-album-guid")] // non-Guid route value
|
||||
[InlineData("00000000-0000-0000-0000-000000000000")] // empty Guid route value
|
||||
[InlineData(null)] // Missing route value.
|
||||
[InlineData("")] // Empty route value.
|
||||
[InlineData(" ")] // Whitespace route value, which both the not empty rule and the format rule reject.
|
||||
[InlineData("not-an-album-guid")] // Non-Guid route value.
|
||||
[InlineData("00000000-0000-0000-0000-000000000000")] // Empty Guid route value.
|
||||
public void Validate_WhenAlbumIdIsEmptyOrInvalid_ShouldHaveValidationError(string? albumId)
|
||||
{
|
||||
// Arrange
|
||||
|
||||
+5
-5
@@ -21,11 +21,11 @@ public class GetDeletedAlbumsQueryValidatorTests
|
||||
private readonly GetDeletedAlbumsQueryValidator _validator = new();
|
||||
|
||||
[Theory]
|
||||
[InlineData(null)] // missing route value
|
||||
[InlineData("")] // empty route value
|
||||
[InlineData(" ")] // whitespace route value, which both the not empty rule and the format rule reject
|
||||
[InlineData("not-a-library-guid")] // non-Guid route value
|
||||
[InlineData("00000000-0000-0000-0000-000000000000")] // empty Guid route value
|
||||
[InlineData(null)] // Missing route value.
|
||||
[InlineData("")] // Empty route value.
|
||||
[InlineData(" ")] // Whitespace route value, which both the not empty rule and the format rule reject.
|
||||
[InlineData("not-a-library-guid")] // Non-Guid route value.
|
||||
[InlineData("00000000-0000-0000-0000-000000000000")] // Empty Guid route value.
|
||||
public void Validate_WhenLibraryIdIsEmptyOrInvalid_ShouldHaveValidationError(string? libraryId)
|
||||
{
|
||||
// Arrange
|
||||
|
||||
+34
-34
@@ -46,11 +46,11 @@ public class AddArtistCommandValidatorTests
|
||||
private readonly IsrcDtoFixture _isrcDtoFixture = new();
|
||||
|
||||
[Theory]
|
||||
[InlineData(null)] // missing route value
|
||||
[InlineData("")] // empty route value
|
||||
[InlineData(" ")] // whitespace route value, which both the not empty rule and the format rule reject
|
||||
[InlineData("not-a-library-guid")] // non-Guid route value
|
||||
[InlineData("00000000-0000-0000-0000-000000000000")] // empty Guid route value
|
||||
[InlineData(null)] // Missing route value.
|
||||
[InlineData("")] // Empty route value.
|
||||
[InlineData(" ")] // Whitespace route value, which both the not empty rule and the format rule reject.
|
||||
[InlineData("not-a-library-guid")] // Non-Guid route value.
|
||||
[InlineData("00000000-0000-0000-0000-000000000000")] // Empty Guid route value.
|
||||
public void Validate_WhenLibraryIdIsEmptyOrInvalid_ShouldHaveValidationError(string? libraryId)
|
||||
{
|
||||
// Arrange
|
||||
@@ -77,8 +77,8 @@ public class AddArtistCommandValidatorTests
|
||||
}
|
||||
|
||||
[Theory]
|
||||
[InlineData("")] // empty name
|
||||
[InlineData(" ")] // whitespace name, which the not empty rule rejects
|
||||
[InlineData("")] // Empty name.
|
||||
[InlineData(" ")] // Whitespace name, which the not empty rule rejects.
|
||||
public void Validate_WhenNameIsEmpty_ShouldHaveValidationError(string name)
|
||||
{
|
||||
// Arrange
|
||||
@@ -290,8 +290,8 @@ public class AddArtistCommandValidatorTests
|
||||
}
|
||||
|
||||
[Theory]
|
||||
[InlineData("")] // empty title
|
||||
[InlineData(" ")] // whitespace title, which the not empty rule rejects
|
||||
[InlineData("")] // Empty title.
|
||||
[InlineData(" ")] // Whitespace title, which the not empty rule rejects.
|
||||
public void Validate_WhenAlbumTitleIsEmpty_ShouldHaveValidationError(string title)
|
||||
{
|
||||
// Arrange
|
||||
@@ -436,8 +436,8 @@ public class AddArtistCommandValidatorTests
|
||||
}
|
||||
|
||||
[Theory]
|
||||
[InlineData(0)] // zero is not a valid total discs value
|
||||
[InlineData(-1)] // a negative total discs value is not valid
|
||||
[InlineData(0)] // Zero is not a valid total discs value.
|
||||
[InlineData(-1)] // A negative total discs value is not valid.
|
||||
public void Validate_WhenAlbumTotalDiscsIsNotPositive_ShouldHaveValidationError(int totalDiscs)
|
||||
{
|
||||
// Arrange
|
||||
@@ -477,8 +477,8 @@ public class AddArtistCommandValidatorTests
|
||||
}
|
||||
|
||||
[Theory]
|
||||
[InlineData(0)] // zero is not a valid total tracks value
|
||||
[InlineData(-1)] // a negative total tracks value is not valid
|
||||
[InlineData(0)] // Zero is not a valid total tracks value.
|
||||
[InlineData(-1)] // A negative total tracks value is not valid.
|
||||
public void Validate_WhenAlbumTotalTracksIsNotPositive_ShouldHaveValidationError(int totalTracks)
|
||||
{
|
||||
// Arrange
|
||||
@@ -921,9 +921,9 @@ public class AddArtistCommandValidatorTests
|
||||
}
|
||||
|
||||
[Theory]
|
||||
[InlineData("123")] // too short to be a barcode
|
||||
[InlineData("abcdefghijkl")] // not numeric
|
||||
[InlineData("12345678901234")] // too long to be a barcode
|
||||
[InlineData("123")] // Too short to be a barcode.
|
||||
[InlineData("abcdefghijkl")] // Not numeric.
|
||||
[InlineData("12345678901234")] // Too long to be a barcode.
|
||||
public void Validate_WhenAlbumBarcodeHasInvalidFormat_ShouldHaveValidationError(string barcode)
|
||||
{
|
||||
// Arrange
|
||||
@@ -937,8 +937,8 @@ public class AddArtistCommandValidatorTests
|
||||
}
|
||||
|
||||
[Theory]
|
||||
[InlineData("123456789012")] // 12 digit barcode
|
||||
[InlineData("1234567890123")] // 13 digit barcode
|
||||
[InlineData("123456789012")] // 12 digit barcode.
|
||||
[InlineData("1234567890123")] // 13 digit barcode.
|
||||
public void Validate_WhenAlbumBarcodeIsValid_ShouldNotHaveValidationError(string barcode)
|
||||
{
|
||||
// Arrange
|
||||
@@ -1070,8 +1070,8 @@ public class AddArtistCommandValidatorTests
|
||||
}
|
||||
|
||||
[Theory]
|
||||
[InlineData(0)] // zero is not a valid rating value
|
||||
[InlineData(-1)] // a negative rating value is not valid
|
||||
[InlineData(0)] // Zero is not a valid rating value.
|
||||
[InlineData(-1)] // A negative rating value is not valid.
|
||||
public void Validate_WhenAlbumRatingValueIsNotPositive_ShouldHaveValidationError(decimal value)
|
||||
{
|
||||
// Arrange
|
||||
@@ -1111,8 +1111,8 @@ public class AddArtistCommandValidatorTests
|
||||
}
|
||||
|
||||
[Theory]
|
||||
[InlineData(0)] // zero is not a valid maximum rating value
|
||||
[InlineData(-1)] // a negative maximum rating value is not valid
|
||||
[InlineData(0)] // Zero is not a valid maximum rating value.
|
||||
[InlineData(-1)] // A negative maximum rating value is not valid.
|
||||
public void Validate_WhenAlbumRatingMaxValueIsNotPositive_ShouldHaveValidationError(decimal maxValue)
|
||||
{
|
||||
// Arrange
|
||||
@@ -1191,8 +1191,8 @@ public class AddArtistCommandValidatorTests
|
||||
}
|
||||
|
||||
[Theory]
|
||||
[InlineData("")] // empty path
|
||||
[InlineData(" ")] // whitespace path, which the not empty rule rejects
|
||||
[InlineData("")] // Empty path.
|
||||
[InlineData(" ")] // Whitespace path, which the not empty rule rejects.
|
||||
public void Validate_WhenTrackPathIsEmpty_ShouldHaveValidationError(string path)
|
||||
{
|
||||
// Arrange
|
||||
@@ -1676,8 +1676,8 @@ public class AddArtistCommandValidatorTests
|
||||
}
|
||||
|
||||
[Theory]
|
||||
[InlineData(0)] // zero is not a valid track number
|
||||
[InlineData(-1)] // a negative track number is not valid
|
||||
[InlineData(0)] // Zero is not a valid track number.
|
||||
[InlineData(-1)] // A negative track number is not valid.
|
||||
public void Validate_WhenTrackNumberIsNotPositive_ShouldHaveValidationError(int trackNumber)
|
||||
{
|
||||
// Arrange
|
||||
@@ -1691,8 +1691,8 @@ public class AddArtistCommandValidatorTests
|
||||
}
|
||||
|
||||
[Theory]
|
||||
[InlineData(0)] // zero is not a valid disc number
|
||||
[InlineData(-1)] // a negative disc number is not valid
|
||||
[InlineData(0)] // Zero is not a valid disc number.
|
||||
[InlineData(-1)] // A negative disc number is not valid.
|
||||
public void Validate_WhenDiscNumberIsNotPositive_ShouldHaveValidationError(int discNumber)
|
||||
{
|
||||
// Arrange
|
||||
@@ -1732,8 +1732,8 @@ public class AddArtistCommandValidatorTests
|
||||
}
|
||||
|
||||
[Theory]
|
||||
[InlineData(0)] // zero is not a valid tempo
|
||||
[InlineData(-1)] // a negative tempo is not valid
|
||||
[InlineData(0)] // Zero is not a valid tempo.
|
||||
[InlineData(-1)] // A negative tempo is not valid.
|
||||
public void Validate_WhenTrackBpmIsNotPositive_ShouldHaveValidationError(int bpm)
|
||||
{
|
||||
// Arrange
|
||||
@@ -1838,8 +1838,8 @@ public class AddArtistCommandValidatorTests
|
||||
}
|
||||
|
||||
[Theory]
|
||||
[InlineData(0)] // zero is not a valid rating value
|
||||
[InlineData(-1)] // a negative rating value is not valid
|
||||
[InlineData(0)] // Zero is not a valid rating value.
|
||||
[InlineData(-1)] // A negative rating value is not valid.
|
||||
public void Validate_WhenTrackRatingValueIsNotPositive_ShouldHaveValidationError(decimal value)
|
||||
{
|
||||
// Arrange
|
||||
@@ -1866,8 +1866,8 @@ public class AddArtistCommandValidatorTests
|
||||
}
|
||||
|
||||
[Theory]
|
||||
[InlineData(0)] // zero is not a valid maximum rating value
|
||||
[InlineData(-1)] // a negative maximum rating value is not valid
|
||||
[InlineData(0)] // Zero is not a valid maximum rating value.
|
||||
[InlineData(-1)] // A negative maximum rating value is not valid.
|
||||
public void Validate_WhenTrackRatingMaxValueIsNotPositive_ShouldHaveValidationError(decimal maxValue)
|
||||
{
|
||||
// Arrange
|
||||
|
||||
+10
-10
@@ -21,11 +21,11 @@ public class DeleteArtistCommandValidatorTests
|
||||
private readonly DeleteArtistCommandValidator _validator = new();
|
||||
|
||||
[Theory]
|
||||
[InlineData(null)] // missing route value
|
||||
[InlineData("")] // empty route value
|
||||
[InlineData(" ")] // whitespace route value, which both the not empty rule and the format rule reject
|
||||
[InlineData("not-a-library-guid")] // non-Guid route value
|
||||
[InlineData("00000000-0000-0000-0000-000000000000")] // empty Guid route value
|
||||
[InlineData(null)] // Missing route value.
|
||||
[InlineData("")] // Empty route value.
|
||||
[InlineData(" ")] // Whitespace route value, which both the not empty rule and the format rule reject.
|
||||
[InlineData("not-a-library-guid")] // Non-Guid route value.
|
||||
[InlineData("00000000-0000-0000-0000-000000000000")] // Empty Guid route value.
|
||||
public void Validate_WhenLibraryIdIsEmptyOrInvalid_ShouldHaveValidationError(string? libraryId)
|
||||
{
|
||||
// Arrange
|
||||
@@ -39,11 +39,11 @@ public class DeleteArtistCommandValidatorTests
|
||||
}
|
||||
|
||||
[Theory]
|
||||
[InlineData(null)] // missing route value
|
||||
[InlineData("")] // empty route value
|
||||
[InlineData(" ")] // whitespace route value, which both the not empty rule and the format rule reject
|
||||
[InlineData("not-an-artist-guid")] // non-Guid route value
|
||||
[InlineData("00000000-0000-0000-0000-000000000000")] // empty Guid route value
|
||||
[InlineData(null)] // Missing route value.
|
||||
[InlineData("")] // Empty route value.
|
||||
[InlineData(" ")] // Whitespace route value, which both the not empty rule and the format rule reject.
|
||||
[InlineData("not-an-artist-guid")] // Non-Guid route value.
|
||||
[InlineData("00000000-0000-0000-0000-000000000000")] // Empty Guid route value.
|
||||
public void Validate_WhenArtistIdIsEmptyOrInvalid_ShouldHaveValidationError(string? artistId)
|
||||
{
|
||||
// Arrange
|
||||
|
||||
+10
-10
@@ -21,11 +21,11 @@ public class RestoreArtistCommandValidatorTests
|
||||
private readonly RestoreArtistCommandValidator _validator = new();
|
||||
|
||||
[Theory]
|
||||
[InlineData(null)] // missing route value
|
||||
[InlineData("")] // empty route value
|
||||
[InlineData(" ")] // whitespace route value, which both the not empty rule and the format rule reject
|
||||
[InlineData("not-a-library-guid")] // non-Guid route value
|
||||
[InlineData("00000000-0000-0000-0000-000000000000")] // empty Guid route value
|
||||
[InlineData(null)] // Missing route value.
|
||||
[InlineData("")] // Empty route value.
|
||||
[InlineData(" ")] // Whitespace route value, which both the not empty rule and the format rule reject.
|
||||
[InlineData("not-a-library-guid")] // Non-Guid route value.
|
||||
[InlineData("00000000-0000-0000-0000-000000000000")] // Empty Guid route value.
|
||||
public void Validate_WhenLibraryIdIsEmptyOrInvalid_ShouldHaveValidationError(string? libraryId)
|
||||
{
|
||||
// Arrange
|
||||
@@ -39,11 +39,11 @@ public class RestoreArtistCommandValidatorTests
|
||||
}
|
||||
|
||||
[Theory]
|
||||
[InlineData(null)] // missing route value
|
||||
[InlineData("")] // empty route value
|
||||
[InlineData(" ")] // whitespace route value, which both the not empty rule and the format rule reject
|
||||
[InlineData("not-an-artist-guid")] // non-Guid route value
|
||||
[InlineData("00000000-0000-0000-0000-000000000000")] // empty Guid route value
|
||||
[InlineData(null)] // Missing route value.
|
||||
[InlineData("")] // Empty route value.
|
||||
[InlineData(" ")] // Whitespace route value, which both the not empty rule and the format rule reject.
|
||||
[InlineData("not-an-artist-guid")] // Non-Guid route value.
|
||||
[InlineData("00000000-0000-0000-0000-000000000000")] // Empty Guid route value.
|
||||
public void Validate_WhenArtistIdIsEmptyOrInvalid_ShouldHaveValidationError(string? artistId)
|
||||
{
|
||||
// Arrange
|
||||
|
||||
+39
-39
@@ -46,11 +46,11 @@ public class UpdateArtistCommandValidatorTests
|
||||
private readonly IsrcDtoFixture _isrcDtoFixture = new();
|
||||
|
||||
[Theory]
|
||||
[InlineData(null)] // missing route value
|
||||
[InlineData("")] // empty route value
|
||||
[InlineData(" ")] // whitespace route value, which both the not empty rule and the format rule reject
|
||||
[InlineData("not-a-library-guid")] // non-Guid route value
|
||||
[InlineData("00000000-0000-0000-0000-000000000000")] // empty Guid route value
|
||||
[InlineData(null)] // Missing route value.
|
||||
[InlineData("")] // Empty route value.
|
||||
[InlineData(" ")] // Whitespace route value, which both the not empty rule and the format rule reject.
|
||||
[InlineData("not-a-library-guid")] // Non-Guid route value.
|
||||
[InlineData("00000000-0000-0000-0000-000000000000")] // Empty Guid route value.
|
||||
public void Validate_WhenLibraryIdIsEmptyOrInvalid_ShouldHaveValidationError(string? libraryId)
|
||||
{
|
||||
// Arrange
|
||||
@@ -64,11 +64,11 @@ public class UpdateArtistCommandValidatorTests
|
||||
}
|
||||
|
||||
[Theory]
|
||||
[InlineData(null)] // missing route value
|
||||
[InlineData("")] // empty route value
|
||||
[InlineData(" ")] // whitespace route value, which both the not empty rule and the format rule reject
|
||||
[InlineData("not-an-artist-guid")] // non-Guid route value
|
||||
[InlineData("00000000-0000-0000-0000-000000000000")] // empty Guid route value
|
||||
[InlineData(null)] // Missing route value.
|
||||
[InlineData("")] // Empty route value.
|
||||
[InlineData(" ")] // Whitespace route value, which both the not empty rule and the format rule reject.
|
||||
[InlineData("not-an-artist-guid")] // Non-Guid route value.
|
||||
[InlineData("00000000-0000-0000-0000-000000000000")] // Empty Guid route value.
|
||||
public void Validate_WhenArtistIdIsEmptyOrInvalid_ShouldHaveValidationError(string? artistId)
|
||||
{
|
||||
// Arrange
|
||||
@@ -95,8 +95,8 @@ public class UpdateArtistCommandValidatorTests
|
||||
}
|
||||
|
||||
[Theory]
|
||||
[InlineData("")] // empty name
|
||||
[InlineData(" ")] // whitespace name, which the not empty rule rejects
|
||||
[InlineData("")] // Empty name.
|
||||
[InlineData(" ")] // Whitespace name, which the not empty rule rejects.
|
||||
public void Validate_WhenNameIsEmpty_ShouldHaveValidationError(string name)
|
||||
{
|
||||
// Arrange
|
||||
@@ -347,8 +347,8 @@ public class UpdateArtistCommandValidatorTests
|
||||
}
|
||||
|
||||
[Theory]
|
||||
[InlineData("")] // empty title
|
||||
[InlineData(" ")] // whitespace title, which the not empty rule rejects
|
||||
[InlineData("")] // Empty title.
|
||||
[InlineData(" ")] // Whitespace title, which the not empty rule rejects.
|
||||
public void Validate_WhenAlbumTitleIsEmpty_ShouldHaveValidationError(string title)
|
||||
{
|
||||
// Arrange
|
||||
@@ -519,8 +519,8 @@ public class UpdateArtistCommandValidatorTests
|
||||
}
|
||||
|
||||
[Theory]
|
||||
[InlineData(0)] // zero is not a valid total discs value
|
||||
[InlineData(-1)] // a negative total discs value is not valid
|
||||
[InlineData(0)] // Zero is not a valid total discs value.
|
||||
[InlineData(-1)] // A negative total discs value is not valid.
|
||||
public void Validate_WhenAlbumTotalDiscsIsNotPositive_ShouldHaveValidationError(int totalDiscs)
|
||||
{
|
||||
// Arrange
|
||||
@@ -547,8 +547,8 @@ public class UpdateArtistCommandValidatorTests
|
||||
}
|
||||
|
||||
[Theory]
|
||||
[InlineData(0)] // zero is not a valid total tracks value
|
||||
[InlineData(-1)] // a negative total tracks value is not valid
|
||||
[InlineData(0)] // Zero is not a valid total tracks value.
|
||||
[InlineData(-1)] // A negative total tracks value is not valid.
|
||||
public void Validate_WhenAlbumTotalTracksIsNotPositive_ShouldHaveValidationError(int totalTracks)
|
||||
{
|
||||
// Arrange
|
||||
@@ -1138,9 +1138,9 @@ public class UpdateArtistCommandValidatorTests
|
||||
}
|
||||
|
||||
[Theory]
|
||||
[InlineData("123")] // too short to be a barcode
|
||||
[InlineData("abcdefghijkl")] // not numeric
|
||||
[InlineData("12345678901234")] // too long to be a barcode
|
||||
[InlineData("123")] // Too short to be a barcode.
|
||||
[InlineData("abcdefghijkl")] // Not numeric.
|
||||
[InlineData("12345678901234")] // Too long to be a barcode.
|
||||
public void Validate_WhenAlbumBarcodeHasInvalidFormat_ShouldHaveValidationError(string barcode)
|
||||
{
|
||||
// Arrange
|
||||
@@ -1154,8 +1154,8 @@ public class UpdateArtistCommandValidatorTests
|
||||
}
|
||||
|
||||
[Theory]
|
||||
[InlineData("123456789012")] // 12 digit barcode
|
||||
[InlineData("1234567890123")] // 13 digit barcode
|
||||
[InlineData("123456789012")] // 12 digit barcode.
|
||||
[InlineData("1234567890123")] // 13 digit barcode.
|
||||
public void Validate_WhenAlbumBarcodeIsValid_ShouldNotHaveValidationError(string barcode)
|
||||
{
|
||||
// Arrange
|
||||
@@ -1315,8 +1315,8 @@ public class UpdateArtistCommandValidatorTests
|
||||
}
|
||||
|
||||
[Theory]
|
||||
[InlineData(0)] // zero is not a valid rating value
|
||||
[InlineData(-1)] // a negative rating value is not valid
|
||||
[InlineData(0)] // Zero is not a valid rating value.
|
||||
[InlineData(-1)] // A negative rating value is not valid.
|
||||
public void Validate_WhenAlbumRatingValueIsNotPositive_ShouldHaveValidationError(decimal value)
|
||||
{
|
||||
// Arrange
|
||||
@@ -1356,8 +1356,8 @@ public class UpdateArtistCommandValidatorTests
|
||||
}
|
||||
|
||||
[Theory]
|
||||
[InlineData(0)] // zero is not a valid maximum rating value
|
||||
[InlineData(-1)] // a negative maximum rating value is not valid
|
||||
[InlineData(0)] // Zero is not a valid maximum rating value.
|
||||
[InlineData(-1)] // A negative maximum rating value is not valid.
|
||||
public void Validate_WhenAlbumRatingMaxValueIsNotPositive_ShouldHaveValidationError(decimal maxValue)
|
||||
{
|
||||
// Arrange
|
||||
@@ -1492,8 +1492,8 @@ public class UpdateArtistCommandValidatorTests
|
||||
}
|
||||
|
||||
[Theory]
|
||||
[InlineData("")] // empty path
|
||||
[InlineData(" ")] // whitespace path, which the not empty rule rejects
|
||||
[InlineData("")] // Empty path.
|
||||
[InlineData(" ")] // Whitespace path, which the not empty rule rejects.
|
||||
public void Validate_WhenTrackPathIsEmpty_ShouldHaveValidationError(string path)
|
||||
{
|
||||
// Arrange
|
||||
@@ -1963,8 +1963,8 @@ public class UpdateArtistCommandValidatorTests
|
||||
}
|
||||
|
||||
[Theory]
|
||||
[InlineData(0)] // zero is not a valid track number
|
||||
[InlineData(-1)] // a negative track number is not valid
|
||||
[InlineData(0)] // Zero is not a valid track number.
|
||||
[InlineData(-1)] // A negative track number is not valid.
|
||||
public void Validate_WhenTrackNumberIsNotPositive_ShouldHaveValidationError(int trackNumber)
|
||||
{
|
||||
// Arrange
|
||||
@@ -1978,8 +1978,8 @@ public class UpdateArtistCommandValidatorTests
|
||||
}
|
||||
|
||||
[Theory]
|
||||
[InlineData(0)] // zero is not a valid disc number
|
||||
[InlineData(-1)] // a negative disc number is not valid
|
||||
[InlineData(0)] // Zero is not a valid disc number.
|
||||
[InlineData(-1)] // A negative disc number is not valid.
|
||||
public void Validate_WhenDiscNumberIsNotPositive_ShouldHaveValidationError(int discNumber)
|
||||
{
|
||||
// Arrange
|
||||
@@ -2019,8 +2019,8 @@ public class UpdateArtistCommandValidatorTests
|
||||
}
|
||||
|
||||
[Theory]
|
||||
[InlineData(0)] // zero is not a valid tempo
|
||||
[InlineData(-1)] // a negative tempo is not valid
|
||||
[InlineData(0)] // Zero is not a valid tempo.
|
||||
[InlineData(-1)] // A negative tempo is not valid.
|
||||
public void Validate_WhenTrackBpmIsNotPositive_ShouldHaveValidationError(int bpm)
|
||||
{
|
||||
// Arrange
|
||||
@@ -2125,8 +2125,8 @@ public class UpdateArtistCommandValidatorTests
|
||||
}
|
||||
|
||||
[Theory]
|
||||
[InlineData(0)] // zero is not a valid rating value
|
||||
[InlineData(-1)] // a negative rating value is not valid
|
||||
[InlineData(0)] // Zero is not a valid rating value.
|
||||
[InlineData(-1)] // A negative rating value is not valid.
|
||||
public void Validate_WhenTrackRatingValueIsNotPositive_ShouldHaveValidationError(decimal value)
|
||||
{
|
||||
// Arrange
|
||||
@@ -2153,8 +2153,8 @@ public class UpdateArtistCommandValidatorTests
|
||||
}
|
||||
|
||||
[Theory]
|
||||
[InlineData(0)] // zero is not a valid maximum rating value
|
||||
[InlineData(-1)] // a negative maximum rating value is not valid
|
||||
[InlineData(0)] // Zero is not a valid maximum rating value.
|
||||
[InlineData(-1)] // A negative maximum rating value is not valid.
|
||||
public void Validate_WhenTrackRatingMaxValueIsNotPositive_ShouldHaveValidationError(decimal maxValue)
|
||||
{
|
||||
// Arrange
|
||||
|
||||
+3
-3
@@ -323,9 +323,9 @@ public class UpdateArtistCoverCommandHandlerTests
|
||||
}
|
||||
|
||||
[Theory]
|
||||
[InlineData(null)] // no file name at all
|
||||
[InlineData("")] // empty file name
|
||||
[InlineData(" ")] // whitespace file name
|
||||
[InlineData(null)] // No file name at all.
|
||||
[InlineData("")] // Empty file name.
|
||||
[InlineData(" ")] // Whitespace file name.
|
||||
public async Task HandleAsync_WhenExistingCoverPathIsEmpty_ShouldNotDeletePreviousArtwork(string? existingCoverPath)
|
||||
{
|
||||
// Arrange
|
||||
|
||||
+10
-10
@@ -21,11 +21,11 @@ public class GetArtistQueryValidatorTests
|
||||
private readonly GetArtistQueryValidator _validator = new();
|
||||
|
||||
[Theory]
|
||||
[InlineData(null)] // missing route value
|
||||
[InlineData("")] // empty route value
|
||||
[InlineData(" ")] // whitespace route value, which both the not empty rule and the format rule reject
|
||||
[InlineData("not-a-library-guid")] // non-Guid route value
|
||||
[InlineData("00000000-0000-0000-0000-000000000000")] // empty Guid route value
|
||||
[InlineData(null)] // Missing route value.
|
||||
[InlineData("")] // Empty route value.
|
||||
[InlineData(" ")] // Whitespace route value, which both the not empty rule and the format rule reject.
|
||||
[InlineData("not-a-library-guid")] // Non-Guid route value.
|
||||
[InlineData("00000000-0000-0000-0000-000000000000")] // Empty Guid route value.
|
||||
public void Validate_WhenLibraryIdIsEmptyOrInvalid_ShouldHaveValidationError(string? libraryId)
|
||||
{
|
||||
// Arrange
|
||||
@@ -39,11 +39,11 @@ public class GetArtistQueryValidatorTests
|
||||
}
|
||||
|
||||
[Theory]
|
||||
[InlineData(null)] // missing route value
|
||||
[InlineData("")] // empty route value
|
||||
[InlineData(" ")] // whitespace route value, which both the not empty rule and the format rule reject
|
||||
[InlineData("not-an-artist-guid")] // non-Guid route value
|
||||
[InlineData("00000000-0000-0000-0000-000000000000")] // empty Guid route value
|
||||
[InlineData(null)] // Missing route value.
|
||||
[InlineData("")] // Empty route value.
|
||||
[InlineData(" ")] // Whitespace route value, which both the not empty rule and the format rule reject.
|
||||
[InlineData("not-an-artist-guid")] // Non-Guid route value.
|
||||
[InlineData("00000000-0000-0000-0000-000000000000")] // Empty Guid route value.
|
||||
public void Validate_WhenArtistIdIsEmptyOrInvalid_ShouldHaveValidationError(string? artistId)
|
||||
{
|
||||
// Arrange
|
||||
|
||||
+10
-10
@@ -21,11 +21,11 @@ public class GetArtistAlbumsQueryValidatorTests
|
||||
private readonly GetArtistAlbumsQueryValidator _validator = new();
|
||||
|
||||
[Theory]
|
||||
[InlineData(null)] // missing route value
|
||||
[InlineData("")] // empty route value
|
||||
[InlineData(" ")] // whitespace route value, which both the not empty rule and the format rule reject
|
||||
[InlineData("not-a-library-guid")] // non-Guid route value
|
||||
[InlineData("00000000-0000-0000-0000-000000000000")] // empty Guid route value
|
||||
[InlineData(null)] // Missing route value.
|
||||
[InlineData("")] // Empty route value.
|
||||
[InlineData(" ")] // Whitespace route value, which both the not empty rule and the format rule reject.
|
||||
[InlineData("not-a-library-guid")] // Non-Guid route value.
|
||||
[InlineData("00000000-0000-0000-0000-000000000000")] // Empty Guid route value.
|
||||
public void Validate_WhenLibraryIdIsEmptyOrInvalid_ShouldHaveValidationError(string? libraryId)
|
||||
{
|
||||
// Arrange
|
||||
@@ -39,11 +39,11 @@ public class GetArtistAlbumsQueryValidatorTests
|
||||
}
|
||||
|
||||
[Theory]
|
||||
[InlineData(null)] // missing route value
|
||||
[InlineData("")] // empty route value
|
||||
[InlineData(" ")] // whitespace route value, which both the not empty rule and the format rule reject
|
||||
[InlineData("not-an-artist-guid")] // non-Guid route value
|
||||
[InlineData("00000000-0000-0000-0000-000000000000")] // empty Guid route value
|
||||
[InlineData(null)] // Missing route value.
|
||||
[InlineData("")] // Empty route value.
|
||||
[InlineData(" ")] // Whitespace route value, which both the not empty rule and the format rule reject.
|
||||
[InlineData("not-an-artist-guid")] // Non-Guid route value.
|
||||
[InlineData("00000000-0000-0000-0000-000000000000")] // Empty Guid route value.
|
||||
public void Validate_WhenArtistIdIsEmptyOrInvalid_ShouldHaveValidationError(string? artistId)
|
||||
{
|
||||
// Arrange
|
||||
|
||||
+10
-10
@@ -21,11 +21,11 @@ public class GetArtistAlbumsLiteQueryValidatorTests
|
||||
private readonly GetArtistAlbumsLiteQueryValidator _validator = new();
|
||||
|
||||
[Theory]
|
||||
[InlineData(null)] // missing route value
|
||||
[InlineData("")] // empty route value
|
||||
[InlineData(" ")] // whitespace route value, which both the not empty rule and the format rule reject
|
||||
[InlineData("not-a-library-guid")] // non-Guid route value
|
||||
[InlineData("00000000-0000-0000-0000-000000000000")] // empty Guid route value
|
||||
[InlineData(null)] // Missing route value.
|
||||
[InlineData("")] // Empty route value.
|
||||
[InlineData(" ")] // Whitespace route value, which both the not empty rule and the format rule reject.
|
||||
[InlineData("not-a-library-guid")] // Non-Guid route value.
|
||||
[InlineData("00000000-0000-0000-0000-000000000000")] // Empty Guid route value.
|
||||
public void Validate_WhenLibraryIdIsEmptyOrInvalid_ShouldHaveValidationError(string? libraryId)
|
||||
{
|
||||
// Arrange
|
||||
@@ -39,11 +39,11 @@ public class GetArtistAlbumsLiteQueryValidatorTests
|
||||
}
|
||||
|
||||
[Theory]
|
||||
[InlineData(null)] // missing route value
|
||||
[InlineData("")] // empty route value
|
||||
[InlineData(" ")] // whitespace route value, which both the not empty rule and the format rule reject
|
||||
[InlineData("not-an-artist-guid")] // non-Guid route value
|
||||
[InlineData("00000000-0000-0000-0000-000000000000")] // empty Guid route value
|
||||
[InlineData(null)] // Missing route value.
|
||||
[InlineData("")] // Empty route value.
|
||||
[InlineData(" ")] // Whitespace route value, which both the not empty rule and the format rule reject.
|
||||
[InlineData("not-an-artist-guid")] // Non-Guid route value.
|
||||
[InlineData("00000000-0000-0000-0000-000000000000")] // Empty Guid route value.
|
||||
public void Validate_WhenArtistIdIsEmptyOrInvalid_ShouldHaveValidationError(string? artistId)
|
||||
{
|
||||
// Arrange
|
||||
|
||||
+5
-5
@@ -21,11 +21,11 @@ public class GetArtistsQueryValidatorTests
|
||||
private readonly GetArtistsQueryValidator _validator = new();
|
||||
|
||||
[Theory]
|
||||
[InlineData(null)] // missing route value
|
||||
[InlineData("")] // empty route value
|
||||
[InlineData(" ")] // whitespace route value, which both the not empty rule and the format rule reject
|
||||
[InlineData("not-a-library-guid")] // non-Guid route value
|
||||
[InlineData("00000000-0000-0000-0000-000000000000")] // empty Guid route value
|
||||
[InlineData(null)] // Missing route value.
|
||||
[InlineData("")] // Empty route value.
|
||||
[InlineData(" ")] // Whitespace route value, which both the not empty rule and the format rule reject.
|
||||
[InlineData("not-a-library-guid")] // Non-Guid route value.
|
||||
[InlineData("00000000-0000-0000-0000-000000000000")] // Empty Guid route value.
|
||||
public void Validate_WhenLibraryIdIsEmptyOrInvalid_ShouldHaveValidationError(string? libraryId)
|
||||
{
|
||||
// Arrange
|
||||
|
||||
+78
-78
@@ -22,11 +22,11 @@ public class GetArtistsLiteQueryValidatorTests
|
||||
private readonly GetArtistsLiteQueryValidator _validator = new();
|
||||
|
||||
[Theory]
|
||||
[InlineData(null)] // missing route value
|
||||
[InlineData("")] // empty route value
|
||||
[InlineData(" ")] // whitespace route value, which both the not empty rule and the format rule reject
|
||||
[InlineData("not-a-library-guid")] // non-Guid route value
|
||||
[InlineData("00000000-0000-0000-0000-000000000000")] // empty Guid route value
|
||||
[InlineData(null)] // Missing route value.
|
||||
[InlineData("")] // Empty route value.
|
||||
[InlineData(" ")] // Whitespace route value, which both the not empty rule and the format rule reject.
|
||||
[InlineData("not-a-library-guid")] // Non-Guid route value.
|
||||
[InlineData("00000000-0000-0000-0000-000000000000")] // Empty Guid route value.
|
||||
public void Validate_WhenLibraryIdIsEmptyOrInvalid_ShouldHaveValidationError(string? libraryId)
|
||||
{
|
||||
// Arrange
|
||||
@@ -66,8 +66,8 @@ public class GetArtistsLiteQueryValidatorTests
|
||||
}
|
||||
|
||||
[Theory]
|
||||
[InlineData("AB")] // more than one character
|
||||
[InlineData("1")] // a digit, which is not a letter, the number bucket, or the symbol bucket
|
||||
[InlineData("AB")] // More than one character.
|
||||
[InlineData("1")] // A digit, which is not a letter, the number bucket, or the symbol bucket.
|
||||
public void Validate_WhenFilterAlphaKeyIsNotASingleLetterOrSpecialKey_ShouldHaveValidationError(string filterAlphaKey)
|
||||
{
|
||||
// Arrange
|
||||
@@ -81,10 +81,10 @@ public class GetArtistsLiteQueryValidatorTests
|
||||
}
|
||||
|
||||
[Theory]
|
||||
[InlineData("Q")] // a single letter
|
||||
[InlineData("q")] // a single lower case letter
|
||||
[InlineData("#")] // the number bucket
|
||||
[InlineData("*")] // the symbol bucket
|
||||
[InlineData("Q")] // A single letter.
|
||||
[InlineData("q")] // A single lower case letter.
|
||||
[InlineData("#")] // The number bucket.
|
||||
[InlineData("*")] // The symbol bucket.
|
||||
public void Validate_WhenFilterAlphaKeyIsASingleLetterOrSpecialKey_ShouldNotHaveValidationError(string filterAlphaKey)
|
||||
{
|
||||
// Arrange
|
||||
@@ -111,8 +111,8 @@ public class GetArtistsLiteQueryValidatorTests
|
||||
}
|
||||
|
||||
[Theory]
|
||||
[InlineData(LibraryItemAlphaKeys.NUMBER)] // the number bucket constant
|
||||
[InlineData(LibraryItemAlphaKeys.SYMBOL)] // the symbol bucket constant
|
||||
[InlineData(LibraryItemAlphaKeys.NUMBER)] // The number bucket constant.
|
||||
[InlineData(LibraryItemAlphaKeys.SYMBOL)] // The symbol bucket constant.
|
||||
public void Validate_WhenFilterAlphaKeyIsTheSpecialConstant_ShouldNotHaveValidationError(string filterAlphaKey)
|
||||
{
|
||||
// Arrange
|
||||
@@ -126,58 +126,58 @@ public class GetArtistsLiteQueryValidatorTests
|
||||
}
|
||||
|
||||
[Theory]
|
||||
[InlineData("A")] // upper case A
|
||||
[InlineData("B")] // upper case B
|
||||
[InlineData("C")] // upper case C
|
||||
[InlineData("D")] // upper case D
|
||||
[InlineData("E")] // upper case E
|
||||
[InlineData("F")] // upper case F
|
||||
[InlineData("G")] // upper case G
|
||||
[InlineData("H")] // upper case H
|
||||
[InlineData("I")] // upper case I
|
||||
[InlineData("J")] // upper case J
|
||||
[InlineData("K")] // upper case K
|
||||
[InlineData("L")] // upper case L
|
||||
[InlineData("M")] // upper case M
|
||||
[InlineData("N")] // upper case N
|
||||
[InlineData("O")] // upper case O
|
||||
[InlineData("P")] // upper case P
|
||||
[InlineData("Q")] // upper case Q
|
||||
[InlineData("R")] // upper case R
|
||||
[InlineData("S")] // upper case S
|
||||
[InlineData("T")] // upper case T
|
||||
[InlineData("U")] // upper case U
|
||||
[InlineData("V")] // upper case V
|
||||
[InlineData("W")] // upper case W
|
||||
[InlineData("X")] // upper case X
|
||||
[InlineData("Y")] // upper case Y
|
||||
[InlineData("Z")] // upper case Z
|
||||
[InlineData("a")] // lower case a
|
||||
[InlineData("b")] // lower case b
|
||||
[InlineData("c")] // lower case c
|
||||
[InlineData("d")] // lower case d
|
||||
[InlineData("e")] // lower case e
|
||||
[InlineData("f")] // lower case f
|
||||
[InlineData("g")] // lower case g
|
||||
[InlineData("h")] // lower case h
|
||||
[InlineData("i")] // lower case i
|
||||
[InlineData("j")] // lower case j
|
||||
[InlineData("k")] // lower case k
|
||||
[InlineData("l")] // lower case l
|
||||
[InlineData("m")] // lower case m
|
||||
[InlineData("n")] // lower case n
|
||||
[InlineData("o")] // lower case o
|
||||
[InlineData("p")] // lower case p
|
||||
[InlineData("q")] // lower case q
|
||||
[InlineData("r")] // lower case r
|
||||
[InlineData("s")] // lower case s
|
||||
[InlineData("t")] // lower case t
|
||||
[InlineData("u")] // lower case u
|
||||
[InlineData("v")] // lower case v
|
||||
[InlineData("w")] // lower case w
|
||||
[InlineData("x")] // lower case x
|
||||
[InlineData("y")] // lower case y
|
||||
[InlineData("z")] // lower case z
|
||||
[InlineData("A")] // Upper case A.
|
||||
[InlineData("B")] // Upper case B.
|
||||
[InlineData("C")] // Upper case C.
|
||||
[InlineData("D")] // Upper case D.
|
||||
[InlineData("E")] // Upper case E.
|
||||
[InlineData("F")] // Upper case F.
|
||||
[InlineData("G")] // Upper case G.
|
||||
[InlineData("H")] // Upper case H.
|
||||
[InlineData("I")] // Upper case I.
|
||||
[InlineData("J")] // Upper case J.
|
||||
[InlineData("K")] // Upper case K.
|
||||
[InlineData("L")] // Upper case L.
|
||||
[InlineData("M")] // Upper case M.
|
||||
[InlineData("N")] // Upper case N.
|
||||
[InlineData("O")] // Upper case O.
|
||||
[InlineData("P")] // Upper case P.
|
||||
[InlineData("Q")] // Upper case Q.
|
||||
[InlineData("R")] // Upper case R.
|
||||
[InlineData("S")] // Upper case S.
|
||||
[InlineData("T")] // Upper case T.
|
||||
[InlineData("U")] // Upper case U.
|
||||
[InlineData("V")] // Upper case V.
|
||||
[InlineData("W")] // Upper case W.
|
||||
[InlineData("X")] // Upper case X.
|
||||
[InlineData("Y")] // Upper case Y.
|
||||
[InlineData("Z")] // Upper case Z.
|
||||
[InlineData("a")] // Lower case a.
|
||||
[InlineData("b")] // Lower case b.
|
||||
[InlineData("c")] // Lower case c.
|
||||
[InlineData("d")] // Lower case d.
|
||||
[InlineData("e")] // Lower case e.
|
||||
[InlineData("f")] // Lower case f.
|
||||
[InlineData("g")] // Lower case g.
|
||||
[InlineData("h")] // Lower case h.
|
||||
[InlineData("i")] // Lower case i.
|
||||
[InlineData("j")] // Lower case j.
|
||||
[InlineData("k")] // Lower case k.
|
||||
[InlineData("l")] // Lower case l.
|
||||
[InlineData("m")] // Lower case m.
|
||||
[InlineData("n")] // Lower case n.
|
||||
[InlineData("o")] // Lower case o.
|
||||
[InlineData("p")] // Lower case p.
|
||||
[InlineData("q")] // Lower case q.
|
||||
[InlineData("r")] // Lower case r.
|
||||
[InlineData("s")] // Lower case s.
|
||||
[InlineData("t")] // Lower case t.
|
||||
[InlineData("u")] // Lower case u.
|
||||
[InlineData("v")] // Lower case v.
|
||||
[InlineData("w")] // Lower case w.
|
||||
[InlineData("x")] // Lower case x.
|
||||
[InlineData("y")] // Lower case y.
|
||||
[InlineData("z")] // Lower case z.
|
||||
public void Validate_WhenFilterAlphaKeyIsAnySingleAsciiLetter_ShouldNotHaveValidationError(string filterAlphaKey)
|
||||
{
|
||||
// Arrange
|
||||
@@ -191,19 +191,19 @@ public class GetArtistsLiteQueryValidatorTests
|
||||
}
|
||||
|
||||
[Theory]
|
||||
[InlineData("")] // empty string, which is not a single letter or a special key
|
||||
[InlineData("AB")] // two letters
|
||||
[InlineData("ABC")] // several letters
|
||||
[InlineData("1")] // a digit, which is not a letter, a number bucket or a symbol bucket
|
||||
[InlineData("9")] // another digit
|
||||
[InlineData("_")] // an underscore, which is not an ASCII letter
|
||||
[InlineData("é")] // a non-ASCII letter
|
||||
[InlineData("#!")] // the number bucket followed by another character
|
||||
[InlineData("**")] // two symbol buckets, which is not the exact symbol constant
|
||||
[InlineData("#A")] // the number bucket followed by a letter
|
||||
[InlineData("*A")] // the symbol bucket followed by a letter
|
||||
[InlineData(" A")] // a leading space followed by a letter
|
||||
[InlineData("A ")] // a letter followed by a trailing space
|
||||
[InlineData("")] // Empty string, which is not a single letter or a special key.
|
||||
[InlineData("AB")] // Two letters.
|
||||
[InlineData("ABC")] // Several letters.
|
||||
[InlineData("1")] // A digit, which is not a letter, a number bucket or a symbol bucket.
|
||||
[InlineData("9")] // Another digit.
|
||||
[InlineData("_")] // An underscore, which is not an ASCII letter.
|
||||
[InlineData("é")] // A non-ASCII letter.
|
||||
[InlineData("#!")] // The number bucket followed by another character.
|
||||
[InlineData("**")] // Two symbol buckets, which is not the exact symbol constant.
|
||||
[InlineData("#A")] // The number bucket followed by a letter.
|
||||
[InlineData("*A")] // The symbol bucket followed by a letter.
|
||||
[InlineData(" A")] // A leading space followed by a letter.
|
||||
[InlineData("A ")] // A letter followed by a trailing space.
|
||||
public void Validate_WhenFilterAlphaKeyIsNotAValidAlphaKey_ShouldHaveValidationError(string filterAlphaKey)
|
||||
{
|
||||
// Arrange
|
||||
|
||||
+5
-5
@@ -21,11 +21,11 @@ public class GetDeletedArtistsQueryValidatorTests
|
||||
private readonly GetDeletedArtistsQueryValidator _validator = new();
|
||||
|
||||
[Theory]
|
||||
[InlineData(null)] // missing route value
|
||||
[InlineData("")] // empty route value
|
||||
[InlineData(" ")] // whitespace route value, which both the not empty rule and the format rule reject
|
||||
[InlineData("not-a-library-guid")] // non-Guid route value
|
||||
[InlineData("00000000-0000-0000-0000-000000000000")] // empty Guid route value
|
||||
[InlineData(null)] // Missing route value.
|
||||
[InlineData("")] // Empty route value.
|
||||
[InlineData(" ")] // Whitespace route value, which both the not empty rule and the format rule reject.
|
||||
[InlineData("not-a-library-guid")] // Non-Guid route value.
|
||||
[InlineData("00000000-0000-0000-0000-000000000000")] // Empty Guid route value.
|
||||
public void Validate_WhenLibraryIdIsEmptyOrInvalid_ShouldHaveValidationError(string? libraryId)
|
||||
{
|
||||
// Arrange
|
||||
|
||||
+6
-6
@@ -17,12 +17,12 @@ public class PlaybackCapabilitiesParserTests
|
||||
private readonly PlaybackCapabilityDtoFixture _playbackCapabilityDtoFixture = new();
|
||||
|
||||
[Theory]
|
||||
[InlineData(null)] // an absent input falls back to the default capabilities
|
||||
[InlineData("")] // an empty input falls back to the default capabilities
|
||||
[InlineData(" ")] // a blank input falls back to the default capabilities
|
||||
[InlineData("not-a-pair")] // an input that does not name both a container and a codec falls back to the default capabilities
|
||||
[InlineData("a/b/c")] // an input with more than two segments falls back to the default capabilities
|
||||
[InlineData("a//b")] // an input whose container or codec is empty falls back to the default capabilities
|
||||
[InlineData(null)] // An absent input falls back to the default capabilities.
|
||||
[InlineData("")] // An empty input falls back to the default capabilities.
|
||||
[InlineData(" ")] // A blank input falls back to the default capabilities.
|
||||
[InlineData("not-a-pair")] // An input that does not name both a container and a codec falls back to the default capabilities.
|
||||
[InlineData("a/b/c")] // An input with more than two segments falls back to the default capabilities.
|
||||
[InlineData("a//b")] // An input whose container or codec is empty falls back to the default capabilities.
|
||||
public void Parse_WhenInputIsNotAValidCapabilitySet_ShouldReturnDefaultCapabilities(string? input)
|
||||
{
|
||||
// Act
|
||||
|
||||
+10
-10
@@ -49,16 +49,16 @@ public class PlaybackDeliveryIdTests
|
||||
}
|
||||
|
||||
[Theory]
|
||||
[InlineData(null)] // an absent handle cannot address a delivery
|
||||
[InlineData("")] // an empty handle has the wrong length
|
||||
[InlineData(" ")] // a whitespace handle has the wrong length
|
||||
[InlineData(" ")] // a handle made only of whitespace has the right length but is not hexadecimal
|
||||
[InlineData("0123456789abcdef0123456789abcde")] // 31 characters, one short of a handle
|
||||
[InlineData("0123456789abcdef0123456789abcdef0")] // 33 characters, one over a handle
|
||||
[InlineData("0123456789ABCDEF0123456789ABCDEF")] // uppercase hexadecimal is not the canonical lowercase form
|
||||
[InlineData("01234567-89ab-cdef-0123-456789abcdef")] // the D format of a Guid carries dashes
|
||||
[InlineData("0123456789abcdef0123456789abcdeg")] // the last character is not a hexadecimal digit
|
||||
[InlineData("zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz")] // no character is a hexadecimal digit
|
||||
[InlineData(null)] // An absent handle cannot address a delivery.
|
||||
[InlineData("")] // An empty handle has the wrong length.
|
||||
[InlineData(" ")] // A whitespace handle has the wrong length.
|
||||
[InlineData(" ")] // A handle made only of whitespace has the right length but is not hexadecimal.
|
||||
[InlineData("0123456789abcdef0123456789abcde")] // 31 characters, one short of a handle.
|
||||
[InlineData("0123456789abcdef0123456789abcdef0")] // 33 characters, one over a handle.
|
||||
[InlineData("0123456789ABCDEF0123456789ABCDEF")] // Uppercase hexadecimal is not the canonical lowercase form.
|
||||
[InlineData("01234567-89ab-cdef-0123-456789abcdef")] // The D format of a Guid carries dashes.
|
||||
[InlineData("0123456789abcdef0123456789abcdeg")] // The last character is not a hexadecimal digit.
|
||||
[InlineData("zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz")] // No character is a hexadecimal digit.
|
||||
public void IsValid_WhenValueIsNotACanonicalHandle_ShouldReturnFalse(string? value)
|
||||
{
|
||||
// Act
|
||||
|
||||
+10
-10
@@ -1009,8 +1009,8 @@ public class AddTrackCommandValidatorTests
|
||||
}
|
||||
|
||||
[Theory]
|
||||
[InlineData(0)] // zero is not a valid track number
|
||||
[InlineData(-1)] // a negative track number is not valid
|
||||
[InlineData(0)] // Zero is not a valid track number.
|
||||
[InlineData(-1)] // A negative track number is not valid.
|
||||
public void Validate_WhenTrackNumberIsNotPositive_ShouldHaveValidationError(int trackNumber)
|
||||
{
|
||||
// Arrange
|
||||
@@ -1037,8 +1037,8 @@ public class AddTrackCommandValidatorTests
|
||||
}
|
||||
|
||||
[Theory]
|
||||
[InlineData(0)] // zero is not a valid disc number
|
||||
[InlineData(-1)] // a negative disc number is not valid
|
||||
[InlineData(0)] // Zero is not a valid disc number.
|
||||
[InlineData(-1)] // A negative disc number is not valid.
|
||||
public void Validate_WhenDiscNumberIsNotPositive_ShouldHaveValidationError(int discNumber)
|
||||
{
|
||||
// Arrange
|
||||
@@ -1156,8 +1156,8 @@ public class AddTrackCommandValidatorTests
|
||||
}
|
||||
|
||||
[Theory]
|
||||
[InlineData(0)] // zero is not a valid tempo
|
||||
[InlineData(-1)] // a negative tempo is not valid
|
||||
[InlineData(0)] // Zero is not a valid tempo.
|
||||
[InlineData(-1)] // A negative tempo is not valid.
|
||||
public void Validate_WhenBpmIsNotPositive_ShouldHaveValidationError(int bpm)
|
||||
{
|
||||
// Arrange
|
||||
@@ -1355,8 +1355,8 @@ public class AddTrackCommandValidatorTests
|
||||
}
|
||||
|
||||
[Theory]
|
||||
[InlineData(0)] // zero is not a valid rating value
|
||||
[InlineData(-1)] // a negative rating value is not valid
|
||||
[InlineData(0)] // Zero is not a valid rating value.
|
||||
[InlineData(-1)] // A negative rating value is not valid.
|
||||
public void Validate_WhenRatingValueIsNotPositive_ShouldHaveValidationError(decimal value)
|
||||
{
|
||||
// Arrange
|
||||
@@ -1383,8 +1383,8 @@ public class AddTrackCommandValidatorTests
|
||||
}
|
||||
|
||||
[Theory]
|
||||
[InlineData(0)] // zero is not a valid maximum rating value
|
||||
[InlineData(-1)] // a negative maximum rating value is not valid
|
||||
[InlineData(0)] // Zero is not a valid maximum rating value.
|
||||
[InlineData(-1)] // A negative maximum rating value is not valid.
|
||||
public void Validate_WhenRatingMaxValueIsNotPositive_ShouldHaveValidationError(decimal maxValue)
|
||||
{
|
||||
// Arrange
|
||||
|
||||
+20
-20
@@ -33,11 +33,11 @@ public class DeleteTrackCommandValidatorTests
|
||||
}
|
||||
|
||||
[Theory]
|
||||
[InlineData(null)] // missing route value
|
||||
[InlineData("")] // empty route value
|
||||
[InlineData(" ")] // whitespace route value, which both the not empty rule and the format rule reject
|
||||
[InlineData("not-a-library-guid")] // non-Guid route value
|
||||
[InlineData("00000000-0000-0000-0000-000000000000")] // empty Guid route value
|
||||
[InlineData(null)] // Missing route value.
|
||||
[InlineData("")] // Empty route value.
|
||||
[InlineData(" ")] // Whitespace route value, which both the not empty rule and the format rule reject.
|
||||
[InlineData("not-a-library-guid")] // Non-Guid route value.
|
||||
[InlineData("00000000-0000-0000-0000-000000000000")] // Empty Guid route value.
|
||||
public void Validate_WhenLibraryIdIsEmptyOrInvalid_ShouldHaveValidationError(string? libraryId)
|
||||
{
|
||||
// Arrange
|
||||
@@ -51,11 +51,11 @@ public class DeleteTrackCommandValidatorTests
|
||||
}
|
||||
|
||||
[Theory]
|
||||
[InlineData(null)] // missing route value
|
||||
[InlineData("")] // empty route value
|
||||
[InlineData(" ")] // whitespace route value, which both the not empty rule and the format rule reject
|
||||
[InlineData("not-an-artist-guid")] // non-Guid route value
|
||||
[InlineData("00000000-0000-0000-0000-000000000000")] // empty Guid route value
|
||||
[InlineData(null)] // Missing route value.
|
||||
[InlineData("")] // Empty route value.
|
||||
[InlineData(" ")] // Whitespace route value, which both the not empty rule and the format rule reject.
|
||||
[InlineData("not-an-artist-guid")] // Non-Guid route value.
|
||||
[InlineData("00000000-0000-0000-0000-000000000000")] // Empty Guid route value.
|
||||
public void Validate_WhenArtistIdIsEmptyOrInvalid_ShouldHaveValidationError(string? artistId)
|
||||
{
|
||||
// Arrange
|
||||
@@ -69,11 +69,11 @@ public class DeleteTrackCommandValidatorTests
|
||||
}
|
||||
|
||||
[Theory]
|
||||
[InlineData(null)] // missing route value
|
||||
[InlineData("")] // empty route value
|
||||
[InlineData(" ")] // whitespace route value, which both the not empty rule and the format rule reject
|
||||
[InlineData("not-an-album-guid")] // non-Guid route value
|
||||
[InlineData("00000000-0000-0000-0000-000000000000")] // empty Guid route value
|
||||
[InlineData(null)] // Missing route value.
|
||||
[InlineData("")] // Empty route value.
|
||||
[InlineData(" ")] // Whitespace route value, which both the not empty rule and the format rule reject.
|
||||
[InlineData("not-an-album-guid")] // Non-Guid route value.
|
||||
[InlineData("00000000-0000-0000-0000-000000000000")] // Empty Guid route value.
|
||||
public void Validate_WhenAlbumIdIsEmptyOrInvalid_ShouldHaveValidationError(string? albumId)
|
||||
{
|
||||
// Arrange
|
||||
@@ -87,11 +87,11 @@ public class DeleteTrackCommandValidatorTests
|
||||
}
|
||||
|
||||
[Theory]
|
||||
[InlineData(null)] // missing route value
|
||||
[InlineData("")] // empty route value
|
||||
[InlineData(" ")] // whitespace route value, which both the not empty rule and the format rule reject
|
||||
[InlineData("not-a-track-guid")] // non-Guid route value
|
||||
[InlineData("00000000-0000-0000-0000-000000000000")] // empty Guid route value
|
||||
[InlineData(null)] // Missing route value.
|
||||
[InlineData("")] // Empty route value.
|
||||
[InlineData(" ")] // Whitespace route value, which both the not empty rule and the format rule reject.
|
||||
[InlineData("not-a-track-guid")] // Non-Guid route value.
|
||||
[InlineData("00000000-0000-0000-0000-000000000000")] // Empty Guid route value.
|
||||
public void Validate_WhenTrackIdIsEmptyOrInvalid_ShouldHaveValidationError(string? trackId)
|
||||
{
|
||||
// Arrange
|
||||
|
||||
+20
-20
@@ -21,11 +21,11 @@ public class RestoreTrackCommandValidatorTests
|
||||
private readonly RestoreTrackCommandValidator _validator = new();
|
||||
|
||||
[Theory]
|
||||
[InlineData(null)] // missing route value
|
||||
[InlineData("")] // empty route value
|
||||
[InlineData(" ")] // whitespace route value, which both the not empty rule and the format rule reject
|
||||
[InlineData("not-a-library-guid")] // non-Guid route value
|
||||
[InlineData("00000000-0000-0000-0000-000000000000")] // empty Guid route value
|
||||
[InlineData(null)] // Missing route value.
|
||||
[InlineData("")] // Empty route value.
|
||||
[InlineData(" ")] // Whitespace route value, which both the not empty rule and the format rule reject.
|
||||
[InlineData("not-a-library-guid")] // Non-Guid route value.
|
||||
[InlineData("00000000-0000-0000-0000-000000000000")] // Empty Guid route value.
|
||||
public void Validate_WhenLibraryIdIsEmptyOrInvalid_ShouldHaveValidationError(string? libraryId)
|
||||
{
|
||||
// Arrange
|
||||
@@ -39,11 +39,11 @@ public class RestoreTrackCommandValidatorTests
|
||||
}
|
||||
|
||||
[Theory]
|
||||
[InlineData(null)] // missing route value
|
||||
[InlineData("")] // empty route value
|
||||
[InlineData(" ")] // whitespace route value, which both the not empty rule and the format rule reject
|
||||
[InlineData("not-an-artist-guid")] // non-Guid route value
|
||||
[InlineData("00000000-0000-0000-0000-000000000000")] // empty Guid route value
|
||||
[InlineData(null)] // Missing route value.
|
||||
[InlineData("")] // Empty route value.
|
||||
[InlineData(" ")] // Whitespace route value, which both the not empty rule and the format rule reject.
|
||||
[InlineData("not-an-artist-guid")] // Non-Guid route value.
|
||||
[InlineData("00000000-0000-0000-0000-000000000000")] // Empty Guid route value.
|
||||
public void Validate_WhenArtistIdIsEmptyOrInvalid_ShouldHaveValidationError(string? artistId)
|
||||
{
|
||||
// Arrange
|
||||
@@ -57,11 +57,11 @@ public class RestoreTrackCommandValidatorTests
|
||||
}
|
||||
|
||||
[Theory]
|
||||
[InlineData(null)] // missing route value
|
||||
[InlineData("")] // empty route value
|
||||
[InlineData(" ")] // whitespace route value, which both the not empty rule and the format rule reject
|
||||
[InlineData("not-an-album-guid")] // non-Guid route value
|
||||
[InlineData("00000000-0000-0000-0000-000000000000")] // empty Guid route value
|
||||
[InlineData(null)] // Missing route value.
|
||||
[InlineData("")] // Empty route value.
|
||||
[InlineData(" ")] // Whitespace route value, which both the not empty rule and the format rule reject.
|
||||
[InlineData("not-an-album-guid")] // Non-Guid route value.
|
||||
[InlineData("00000000-0000-0000-0000-000000000000")] // Empty Guid route value.
|
||||
public void Validate_WhenAlbumIdIsEmptyOrInvalid_ShouldHaveValidationError(string? albumId)
|
||||
{
|
||||
// Arrange
|
||||
@@ -75,11 +75,11 @@ public class RestoreTrackCommandValidatorTests
|
||||
}
|
||||
|
||||
[Theory]
|
||||
[InlineData(null)] // missing route value
|
||||
[InlineData("")] // empty route value
|
||||
[InlineData(" ")] // whitespace route value, which both the not empty rule and the format rule reject
|
||||
[InlineData("not-a-track-guid")] // non-Guid route value
|
||||
[InlineData("00000000-0000-0000-0000-000000000000")] // empty Guid route value
|
||||
[InlineData(null)] // Missing route value.
|
||||
[InlineData("")] // Empty route value.
|
||||
[InlineData(" ")] // Whitespace route value, which both the not empty rule and the format rule reject.
|
||||
[InlineData("not-a-track-guid")] // Non-Guid route value.
|
||||
[InlineData("00000000-0000-0000-0000-000000000000")] // Empty Guid route value.
|
||||
public void Validate_WhenTrackIdIsEmptyOrInvalid_ShouldHaveValidationError(string? trackId)
|
||||
{
|
||||
// Arrange
|
||||
|
||||
+5
-5
@@ -21,11 +21,11 @@ public class GetDeletedTracksQueryValidatorTests
|
||||
private readonly GetDeletedTracksQueryValidator _validator = new();
|
||||
|
||||
[Theory]
|
||||
[InlineData(null)] // missing route value
|
||||
[InlineData("")] // empty route value
|
||||
[InlineData(" ")] // whitespace route value, which both the not empty rule and the format rule reject
|
||||
[InlineData("not-a-library-guid")] // non-Guid route value
|
||||
[InlineData("00000000-0000-0000-0000-000000000000")] // empty Guid route value
|
||||
[InlineData(null)] // Missing route value.
|
||||
[InlineData("")] // Empty route value.
|
||||
[InlineData(" ")] // Whitespace route value, which both the not empty rule and the format rule reject.
|
||||
[InlineData("not-a-library-guid")] // Non-Guid route value.
|
||||
[InlineData("00000000-0000-0000-0000-000000000000")] // Empty Guid route value.
|
||||
public void Validate_WhenLibraryIdIsEmptyOrInvalid_ShouldHaveValidationError(string? libraryId)
|
||||
{
|
||||
// Arrange
|
||||
|
||||
+20
-20
@@ -34,11 +34,11 @@ public class GetPlaybackManifestQueryValidatorTests
|
||||
}
|
||||
|
||||
[Theory]
|
||||
[InlineData(null)] // missing route value
|
||||
[InlineData("")] // empty route value
|
||||
[InlineData(" ")] // whitespace route value
|
||||
[InlineData("not-a-library-guid")] // non-Guid route value
|
||||
[InlineData("00000000-0000-0000-0000-000000000000")] // empty Guid route value
|
||||
[InlineData(null)] // Missing route value.
|
||||
[InlineData("")] // Empty route value.
|
||||
[InlineData(" ")] // Whitespace route value.
|
||||
[InlineData("not-a-library-guid")] // Non-Guid route value.
|
||||
[InlineData("00000000-0000-0000-0000-000000000000")] // Empty Guid route value.
|
||||
public void Validate_WhenLibraryIdIsEmptyOrInvalid_ShouldHaveLibraryIdError(string? libraryId)
|
||||
{
|
||||
// Arrange
|
||||
@@ -52,11 +52,11 @@ public class GetPlaybackManifestQueryValidatorTests
|
||||
}
|
||||
|
||||
[Theory]
|
||||
[InlineData(null)] // missing route value
|
||||
[InlineData("")] // empty route value
|
||||
[InlineData(" ")] // whitespace route value
|
||||
[InlineData("not-an-artist-guid")] // non-Guid route value
|
||||
[InlineData("00000000-0000-0000-0000-000000000000")] // empty Guid route value
|
||||
[InlineData(null)] // Missing route value.
|
||||
[InlineData("")] // Empty route value.
|
||||
[InlineData(" ")] // Whitespace route value.
|
||||
[InlineData("not-an-artist-guid")] // Non-Guid route value.
|
||||
[InlineData("00000000-0000-0000-0000-000000000000")] // Empty Guid route value.
|
||||
public void Validate_WhenArtistIdIsEmptyOrInvalid_ShouldHaveArtistIdError(string? artistId)
|
||||
{
|
||||
// Arrange
|
||||
@@ -70,11 +70,11 @@ public class GetPlaybackManifestQueryValidatorTests
|
||||
}
|
||||
|
||||
[Theory]
|
||||
[InlineData(null)] // missing route value
|
||||
[InlineData("")] // empty route value
|
||||
[InlineData(" ")] // whitespace route value
|
||||
[InlineData("not-an-album-guid")] // non-Guid route value
|
||||
[InlineData("00000000-0000-0000-0000-000000000000")] // empty Guid route value
|
||||
[InlineData(null)] // Missing route value.
|
||||
[InlineData("")] // Empty route value.
|
||||
[InlineData(" ")] // Whitespace route value.
|
||||
[InlineData("not-an-album-guid")] // Non-Guid route value.
|
||||
[InlineData("00000000-0000-0000-0000-000000000000")] // Empty Guid route value.
|
||||
public void Validate_WhenAlbumIdIsEmptyOrInvalid_ShouldHaveAlbumIdError(string? albumId)
|
||||
{
|
||||
// Arrange
|
||||
@@ -88,11 +88,11 @@ public class GetPlaybackManifestQueryValidatorTests
|
||||
}
|
||||
|
||||
[Theory]
|
||||
[InlineData(null)] // missing route value
|
||||
[InlineData("")] // empty route value
|
||||
[InlineData(" ")] // whitespace route value
|
||||
[InlineData("not-a-track-guid")] // non-Guid route value
|
||||
[InlineData("00000000-0000-0000-0000-000000000000")] // empty Guid route value
|
||||
[InlineData(null)] // Missing route value.
|
||||
[InlineData("")] // Empty route value.
|
||||
[InlineData(" ")] // Whitespace route value.
|
||||
[InlineData("not-a-track-guid")] // Non-Guid route value.
|
||||
[InlineData("00000000-0000-0000-0000-000000000000")] // Empty Guid route value.
|
||||
public void Validate_WhenTrackIdIsEmptyOrInvalid_ShouldHaveTrackIdError(string? trackId)
|
||||
{
|
||||
// Arrange
|
||||
|
||||
+20
-20
@@ -36,11 +36,11 @@ public class GetTrackQueryValidatorTests
|
||||
}
|
||||
|
||||
[Theory]
|
||||
[InlineData(null)] // missing route value
|
||||
[InlineData("")] // empty route value
|
||||
[InlineData(" ")] // whitespace route value, which both the not empty rule and the format rule reject
|
||||
[InlineData("not-a-library-guid")] // non-Guid route value
|
||||
[InlineData("00000000-0000-0000-0000-000000000000")] // empty Guid route value
|
||||
[InlineData(null)] // Missing route value.
|
||||
[InlineData("")] // Empty route value.
|
||||
[InlineData(" ")] // Whitespace route value, which both the not empty rule and the format rule reject.
|
||||
[InlineData("not-a-library-guid")] // Non-Guid route value.
|
||||
[InlineData("00000000-0000-0000-0000-000000000000")] // Empty Guid route value.
|
||||
public void Validate_WhenLibraryIdIsEmptyOrInvalid_ShouldHaveValidationError(string? libraryId)
|
||||
{
|
||||
// Arrange
|
||||
@@ -54,11 +54,11 @@ public class GetTrackQueryValidatorTests
|
||||
}
|
||||
|
||||
[Theory]
|
||||
[InlineData(null)] // missing route value
|
||||
[InlineData("")] // empty route value
|
||||
[InlineData(" ")] // whitespace route value, which both the not empty rule and the format rule reject
|
||||
[InlineData("not-an-artist-guid")] // non-Guid route value
|
||||
[InlineData("00000000-0000-0000-0000-000000000000")] // empty Guid route value
|
||||
[InlineData(null)] // Missing route value.
|
||||
[InlineData("")] // Empty route value.
|
||||
[InlineData(" ")] // Whitespace route value, which both the not empty rule and the format rule reject.
|
||||
[InlineData("not-an-artist-guid")] // Non-Guid route value.
|
||||
[InlineData("00000000-0000-0000-0000-000000000000")] // Empty Guid route value.
|
||||
public void Validate_WhenArtistIdIsEmptyOrInvalid_ShouldHaveValidationError(string? artistId)
|
||||
{
|
||||
// Arrange
|
||||
@@ -72,11 +72,11 @@ public class GetTrackQueryValidatorTests
|
||||
}
|
||||
|
||||
[Theory]
|
||||
[InlineData(null)] // missing route value
|
||||
[InlineData("")] // empty route value
|
||||
[InlineData(" ")] // whitespace route value, which both the not empty rule and the format rule reject
|
||||
[InlineData("not-an-album-guid")] // non-Guid route value
|
||||
[InlineData("00000000-0000-0000-0000-000000000000")] // empty Guid route value
|
||||
[InlineData(null)] // Missing route value.
|
||||
[InlineData("")] // Empty route value.
|
||||
[InlineData(" ")] // Whitespace route value, which both the not empty rule and the format rule reject.
|
||||
[InlineData("not-an-album-guid")] // Non-Guid route value.
|
||||
[InlineData("00000000-0000-0000-0000-000000000000")] // Empty Guid route value.
|
||||
public void Validate_WhenAlbumIdIsEmptyOrInvalid_ShouldHaveValidationError(string? albumId)
|
||||
{
|
||||
// Arrange
|
||||
@@ -90,11 +90,11 @@ public class GetTrackQueryValidatorTests
|
||||
}
|
||||
|
||||
[Theory]
|
||||
[InlineData(null)] // missing route value
|
||||
[InlineData("")] // empty route value
|
||||
[InlineData(" ")] // whitespace route value, which both the not empty rule and the format rule reject
|
||||
[InlineData("not-a-track-guid")] // non-Guid route value
|
||||
[InlineData("00000000-0000-0000-0000-000000000000")] // empty Guid route value
|
||||
[InlineData(null)] // Missing route value.
|
||||
[InlineData("")] // Empty route value.
|
||||
[InlineData(" ")] // Whitespace route value, which both the not empty rule and the format rule reject.
|
||||
[InlineData("not-a-track-guid")] // Non-Guid route value.
|
||||
[InlineData("00000000-0000-0000-0000-000000000000")] // Empty Guid route value.
|
||||
public void Validate_WhenTrackIdIsEmptyOrInvalid_ShouldHaveValidationError(string? trackId)
|
||||
{
|
||||
// Arrange
|
||||
|
||||
+2
-2
@@ -191,8 +191,8 @@ public class GetTrackSegmentQueryHandlerTests
|
||||
|
||||
public static TheoryData<PlaybackDeliveryShape, int> NonSegmentDeliveryCases => new()
|
||||
{
|
||||
{ PlaybackDeliveryShape.ByteRangeSeekable, 6 }, // a byte range delivery has no indexable segment
|
||||
{ PlaybackDeliveryShape.TimeAddressedSegments, 0 } // a time addressed delivery without a positive segment duration has nothing to index
|
||||
{ PlaybackDeliveryShape.ByteRangeSeekable, 6 }, // A byte range delivery has no indexable segment.
|
||||
{ PlaybackDeliveryShape.TimeAddressedSegments, 0 } // A time addressed delivery without a positive segment duration has nothing to index.
|
||||
};
|
||||
|
||||
[Theory]
|
||||
|
||||
+37
-37
@@ -36,11 +36,11 @@ public class GetTrackSegmentQueryValidatorTests
|
||||
}
|
||||
|
||||
[Theory]
|
||||
[InlineData(null)] // missing route value
|
||||
[InlineData("")] // empty route value
|
||||
[InlineData(" ")] // whitespace route value
|
||||
[InlineData("not-a-library-guid")] // non-Guid route value
|
||||
[InlineData("00000000-0000-0000-0000-000000000000")] // empty Guid route value
|
||||
[InlineData(null)] // Missing route value.
|
||||
[InlineData("")] // Empty route value.
|
||||
[InlineData(" ")] // Whitespace route value.
|
||||
[InlineData("not-a-library-guid")] // Non-Guid route value.
|
||||
[InlineData("00000000-0000-0000-0000-000000000000")] // Empty Guid route value.
|
||||
public void Validate_WhenLibraryIdIsEmptyOrInvalid_ShouldHaveLibraryIdError(string? libraryId)
|
||||
{
|
||||
// Arrange
|
||||
@@ -54,11 +54,11 @@ public class GetTrackSegmentQueryValidatorTests
|
||||
}
|
||||
|
||||
[Theory]
|
||||
[InlineData(null)] // missing route value
|
||||
[InlineData("")] // empty route value
|
||||
[InlineData(" ")] // whitespace route value
|
||||
[InlineData("not-an-artist-guid")] // non-Guid route value
|
||||
[InlineData("00000000-0000-0000-0000-000000000000")] // empty Guid route value
|
||||
[InlineData(null)] // Missing route value.
|
||||
[InlineData("")] // Empty route value.
|
||||
[InlineData(" ")] // Whitespace route value.
|
||||
[InlineData("not-an-artist-guid")] // Non-Guid route value.
|
||||
[InlineData("00000000-0000-0000-0000-000000000000")] // Empty Guid route value.
|
||||
public void Validate_WhenArtistIdIsEmptyOrInvalid_ShouldHaveArtistIdError(string? artistId)
|
||||
{
|
||||
// Arrange
|
||||
@@ -72,11 +72,11 @@ public class GetTrackSegmentQueryValidatorTests
|
||||
}
|
||||
|
||||
[Theory]
|
||||
[InlineData(null)] // missing route value
|
||||
[InlineData("")] // empty route value
|
||||
[InlineData(" ")] // whitespace route value
|
||||
[InlineData("not-an-album-guid")] // non-Guid route value
|
||||
[InlineData("00000000-0000-0000-0000-000000000000")] // empty Guid route value
|
||||
[InlineData(null)] // Missing route value.
|
||||
[InlineData("")] // Empty route value.
|
||||
[InlineData(" ")] // Whitespace route value.
|
||||
[InlineData("not-an-album-guid")] // Non-Guid route value.
|
||||
[InlineData("00000000-0000-0000-0000-000000000000")] // Empty Guid route value.
|
||||
public void Validate_WhenAlbumIdIsEmptyOrInvalid_ShouldHaveAlbumIdError(string? albumId)
|
||||
{
|
||||
// Arrange
|
||||
@@ -90,11 +90,11 @@ public class GetTrackSegmentQueryValidatorTests
|
||||
}
|
||||
|
||||
[Theory]
|
||||
[InlineData(null)] // missing route value
|
||||
[InlineData("")] // empty route value
|
||||
[InlineData(" ")] // whitespace route value
|
||||
[InlineData("not-a-track-guid")] // non-Guid route value
|
||||
[InlineData("00000000-0000-0000-0000-000000000000")] // empty Guid route value
|
||||
[InlineData(null)] // Missing route value.
|
||||
[InlineData("")] // Empty route value.
|
||||
[InlineData(" ")] // Whitespace route value.
|
||||
[InlineData("not-a-track-guid")] // Non-Guid route value.
|
||||
[InlineData("00000000-0000-0000-0000-000000000000")] // Empty Guid route value.
|
||||
public void Validate_WhenTrackIdIsEmptyOrInvalid_ShouldHaveTrackIdError(string? trackId)
|
||||
{
|
||||
// Arrange
|
||||
@@ -108,9 +108,9 @@ public class GetTrackSegmentQueryValidatorTests
|
||||
}
|
||||
|
||||
[Theory]
|
||||
[InlineData(null)] // missing route value
|
||||
[InlineData("")] // empty route value
|
||||
[InlineData(" ")] // whitespace route value
|
||||
[InlineData(null)] // Missing route value.
|
||||
[InlineData("")] // Empty route value.
|
||||
[InlineData(" ")] // Whitespace route value.
|
||||
public void Validate_WhenDeliveryIdIsEmpty_ShouldHaveDeliveryIdCannotBeEmptyError(string? deliveryId)
|
||||
{
|
||||
// Arrange
|
||||
@@ -124,11 +124,11 @@ public class GetTrackSegmentQueryValidatorTests
|
||||
}
|
||||
|
||||
[Theory]
|
||||
[InlineData("0123456789ABCDEF0123456789ABCDEF")] // uppercase hexadecimal is not the canonical lowercase handle
|
||||
[InlineData("01234567-89ab-cdef-0123-456789abcdef")] // the D format of a Guid carries dashes
|
||||
[InlineData("0123456789abcdef0123456789abcde")] // 31 characters, one short of a handle
|
||||
[InlineData("0123456789abcdef0123456789abcdef0")] // 33 characters, one over a handle
|
||||
[InlineData("0123456789abcdef0123456789abcdeg")] // the last character is not a hexadecimal digit
|
||||
[InlineData("0123456789ABCDEF0123456789ABCDEF")] // Uppercase hexadecimal is not the canonical lowercase handle.
|
||||
[InlineData("01234567-89ab-cdef-0123-456789abcdef")] // The D format of a Guid carries dashes.
|
||||
[InlineData("0123456789abcdef0123456789abcde")] // 31 characters, one short of a handle.
|
||||
[InlineData("0123456789abcdef0123456789abcdef0")] // 33 characters, one over a handle.
|
||||
[InlineData("0123456789abcdef0123456789abcdeg")] // The last character is not a hexadecimal digit.
|
||||
public void Validate_WhenDeliveryIdShapeIsInvalid_ShouldHaveDeliveryIdIsInvalidError(string deliveryId)
|
||||
{
|
||||
// Arrange
|
||||
@@ -142,9 +142,9 @@ public class GetTrackSegmentQueryValidatorTests
|
||||
}
|
||||
|
||||
[Theory]
|
||||
[InlineData(null)] // missing route value
|
||||
[InlineData("")] // empty route value
|
||||
[InlineData(" ")] // whitespace route value
|
||||
[InlineData(null)] // Missing route value.
|
||||
[InlineData("")] // Empty route value.
|
||||
[InlineData(" ")] // Whitespace route value.
|
||||
public void Validate_WhenSegmentIndexIsEmpty_ShouldHaveSegmentIndexCannotBeEmptyError(string? segmentIndex)
|
||||
{
|
||||
// Arrange
|
||||
@@ -158,10 +158,10 @@ public class GetTrackSegmentQueryValidatorTests
|
||||
}
|
||||
|
||||
[Theory]
|
||||
[InlineData("-1")] // a negative index does not address a segment
|
||||
[InlineData("abc")] // a non-numeric index does not address a segment
|
||||
[InlineData("1.5")] // a fractional index does not address a segment
|
||||
[InlineData("2147483648")] // a value above the range of an integer
|
||||
[InlineData("-1")] // A negative index does not address a segment.
|
||||
[InlineData("abc")] // A non-numeric index does not address a segment.
|
||||
[InlineData("1.5")] // A fractional index does not address a segment.
|
||||
[InlineData("2147483648")] // A value above the range of an integer.
|
||||
public void Validate_WhenSegmentIndexIsNotANonNegativeInteger_ShouldHaveSegmentIndexMustBeValidError(string segmentIndex)
|
||||
{
|
||||
// Arrange
|
||||
@@ -175,8 +175,8 @@ public class GetTrackSegmentQueryValidatorTests
|
||||
}
|
||||
|
||||
[Theory]
|
||||
[InlineData("0")] // the first segment of the audio
|
||||
[InlineData("2147483647")] // the largest index an integer can address
|
||||
[InlineData("0")] // The first segment of the audio.
|
||||
[InlineData("2147483647")] // The largest index an integer can address.
|
||||
public void Validate_WhenSegmentIndexIsANonNegativeInteger_ShouldNotHaveSegmentIndexMustBeValidError(string segmentIndex)
|
||||
{
|
||||
// Arrange
|
||||
|
||||
+20
-20
@@ -34,11 +34,11 @@ public class GetTrackStreamQueryValidatorTests
|
||||
}
|
||||
|
||||
[Theory]
|
||||
[InlineData(null)] // missing route value
|
||||
[InlineData("")] // empty route value
|
||||
[InlineData(" ")] // whitespace route value
|
||||
[InlineData("not-a-library-guid")] // non-Guid route value
|
||||
[InlineData("00000000-0000-0000-0000-000000000000")] // empty Guid route value
|
||||
[InlineData(null)] // Missing route value.
|
||||
[InlineData("")] // Empty route value.
|
||||
[InlineData(" ")] // Whitespace route value.
|
||||
[InlineData("not-a-library-guid")] // Non-Guid route value.
|
||||
[InlineData("00000000-0000-0000-0000-000000000000")] // Empty Guid route value.
|
||||
public void Validate_WhenLibraryIdIsEmptyOrInvalid_ShouldHaveLibraryIdError(string? libraryId)
|
||||
{
|
||||
// Arrange
|
||||
@@ -52,11 +52,11 @@ public class GetTrackStreamQueryValidatorTests
|
||||
}
|
||||
|
||||
[Theory]
|
||||
[InlineData(null)] // missing route value
|
||||
[InlineData("")] // empty route value
|
||||
[InlineData(" ")] // whitespace route value
|
||||
[InlineData("not-an-artist-guid")] // non-Guid route value
|
||||
[InlineData("00000000-0000-0000-0000-000000000000")] // empty Guid route value
|
||||
[InlineData(null)] // Missing route value.
|
||||
[InlineData("")] // Empty route value.
|
||||
[InlineData(" ")] // Whitespace route value.
|
||||
[InlineData("not-an-artist-guid")] // Non-Guid route value.
|
||||
[InlineData("00000000-0000-0000-0000-000000000000")] // Empty Guid route value.
|
||||
public void Validate_WhenArtistIdIsEmptyOrInvalid_ShouldHaveArtistIdError(string? artistId)
|
||||
{
|
||||
// Arrange
|
||||
@@ -70,11 +70,11 @@ public class GetTrackStreamQueryValidatorTests
|
||||
}
|
||||
|
||||
[Theory]
|
||||
[InlineData(null)] // missing route value
|
||||
[InlineData("")] // empty route value
|
||||
[InlineData(" ")] // whitespace route value
|
||||
[InlineData("not-an-album-guid")] // non-Guid route value
|
||||
[InlineData("00000000-0000-0000-0000-000000000000")] // empty Guid route value
|
||||
[InlineData(null)] // Missing route value.
|
||||
[InlineData("")] // Empty route value.
|
||||
[InlineData(" ")] // Whitespace route value.
|
||||
[InlineData("not-an-album-guid")] // Non-Guid route value.
|
||||
[InlineData("00000000-0000-0000-0000-000000000000")] // Empty Guid route value.
|
||||
public void Validate_WhenAlbumIdIsEmptyOrInvalid_ShouldHaveAlbumIdError(string? albumId)
|
||||
{
|
||||
// Arrange
|
||||
@@ -88,11 +88,11 @@ public class GetTrackStreamQueryValidatorTests
|
||||
}
|
||||
|
||||
[Theory]
|
||||
[InlineData(null)] // missing route value
|
||||
[InlineData("")] // empty route value
|
||||
[InlineData(" ")] // whitespace route value
|
||||
[InlineData("not-a-track-guid")] // non-Guid route value
|
||||
[InlineData("00000000-0000-0000-0000-000000000000")] // empty Guid route value
|
||||
[InlineData(null)] // Missing route value.
|
||||
[InlineData("")] // Empty route value.
|
||||
[InlineData(" ")] // Whitespace route value.
|
||||
[InlineData("not-a-track-guid")] // Non-Guid route value.
|
||||
[InlineData("00000000-0000-0000-0000-000000000000")] // Empty Guid route value.
|
||||
public void Validate_WhenTrackIdIsEmptyOrInvalid_ShouldHaveTrackIdError(string? trackId)
|
||||
{
|
||||
// Arrange
|
||||
|
||||
+14
-14
@@ -21,8 +21,8 @@ public class ShuffleTracksQueryValidatorTests
|
||||
private readonly ShuffleTracksQueryValidator _validator = new();
|
||||
|
||||
[Theory]
|
||||
[InlineData(1)] // the smallest allowed selection
|
||||
[InlineData(500)] // the largest allowed selection
|
||||
[InlineData(1)] // The smallest allowed selection.
|
||||
[InlineData(500)] // The largest allowed selection.
|
||||
public void Validate_WhenQueryIsValid_ShouldNotHaveValidationError(int count)
|
||||
{
|
||||
// Arrange
|
||||
@@ -43,12 +43,12 @@ public class ShuffleTracksQueryValidatorTests
|
||||
}
|
||||
|
||||
[Theory]
|
||||
[InlineData(null)] // missing route value
|
||||
[InlineData("")] // empty route value
|
||||
[InlineData(" ")] // whitespace route value
|
||||
[InlineData("not-a-guid")] // non-Guid route value
|
||||
[InlineData("' OR '1'='1")] // injection payload that is not a Guid
|
||||
[InlineData("00000000-0000-0000-0000-000000000000")] // empty Guid route value
|
||||
[InlineData(null)] // Missing route value.
|
||||
[InlineData("")] // Empty route value.
|
||||
[InlineData(" ")] // Whitespace route value.
|
||||
[InlineData("not-a-guid")] // Non-Guid route value.
|
||||
[InlineData("' OR '1'='1")] // Injection payload that is not a Guid.
|
||||
[InlineData("00000000-0000-0000-0000-000000000000")] // Empty Guid route value.
|
||||
public void Validate_WhenLibraryIdIsEmptyOrInvalid_ShouldHaveValidationError(string? libraryId)
|
||||
{
|
||||
// Arrange
|
||||
@@ -62,9 +62,9 @@ public class ShuffleTracksQueryValidatorTests
|
||||
}
|
||||
|
||||
[Theory]
|
||||
[InlineData(0)] // no track is requested
|
||||
[InlineData(-1)] // a negative selection size
|
||||
[InlineData(-500)] // a large negative selection size
|
||||
[InlineData(0)] // No track is requested.
|
||||
[InlineData(-1)] // A negative selection size.
|
||||
[InlineData(-500)] // A large negative selection size.
|
||||
public void Validate_WhenCountIsNotPositive_ShouldHaveValidationError(int count)
|
||||
{
|
||||
// Arrange
|
||||
@@ -79,9 +79,9 @@ public class ShuffleTracksQueryValidatorTests
|
||||
}
|
||||
|
||||
[Theory]
|
||||
[InlineData(501)] // one more than the documented maximum
|
||||
[InlineData(1000)] // well above the documented maximum
|
||||
[InlineData(int.MaxValue)] // the largest possible value
|
||||
[InlineData(501)] // One more than the documented maximum.
|
||||
[InlineData(1000)] // Well above the documented maximum.
|
||||
[InlineData(int.MaxValue)] // The largest possible value.
|
||||
public void Validate_WhenCountExceedsMaximum_ShouldHaveValidationError(int count)
|
||||
{
|
||||
// Arrange
|
||||
|
||||
+1
-1
@@ -90,7 +90,7 @@ public class AddLibraryCommandValidatorTests
|
||||
{
|
||||
// Arrange
|
||||
AddLibraryCommand command = _addLibraryCommandFixture.Create();
|
||||
command = command with { LibraryType = "0" }; // Book
|
||||
command = command with { LibraryType = "0" }; // Book.
|
||||
|
||||
// Act
|
||||
List<Error> result = _validator.TestValidate(command);
|
||||
|
||||
+1
-1
@@ -58,7 +58,7 @@ public class ScanLibrariesCommandHandlerTests
|
||||
_mockDomainEventsQueue = Substitute.For<IDomainEventsQueue>();
|
||||
_userId = Guid.NewGuid();
|
||||
|
||||
// default stubs: the current user is authenticated and is an admin
|
||||
// Default stubs: the current user is authenticated and is an admin.
|
||||
_mockCurrentUserService.UserId.Returns(_userId);
|
||||
_mockAuthorizationService.IsInRoleAsync(_userId, "Admin", Arg.Any<CancellationToken>()).Returns(true);
|
||||
_mockLibraryScanRepository.GetPastMonthScansByLibraryIdAsync(Arg.Any<Guid>(), Arg.Any<CancellationToken>())
|
||||
|
||||
+1
-1
@@ -63,7 +63,7 @@ public class ScanLibraryCommandHandlerTests
|
||||
_mockValidator = Substitute.For<IValidator<ScanLibraryCommand>>();
|
||||
_userId = Guid.NewGuid();
|
||||
|
||||
// default stubs: the current user is authenticated and the ownership policy allows the scan
|
||||
// Default stubs: the current user is authenticated and the ownership policy allows the scan.
|
||||
_mockCurrentUserService.UserId.Returns(_userId);
|
||||
_mockAuthorizationService.EvaluatePolicyAsync<ILibraryOwnershipPolicy>(_userId, Arg.Any<LibraryOwnershipPolicyContext>(), Arg.Any<CancellationToken>())
|
||||
.Returns(true);
|
||||
|
||||
+1
-1
@@ -117,7 +117,7 @@ public class UpdateLibraryCommandValidatorTests
|
||||
{
|
||||
// Arrange
|
||||
UpdateLibraryCommand command = _updateLibraryCommandFixture.Create();
|
||||
command = command with { LibraryType = "0" }; // Book
|
||||
command = command with { LibraryType = "0" }; // Book.
|
||||
|
||||
// Act
|
||||
List<Error> result = _validator.TestValidate(command);
|
||||
|
||||
+1
-1
@@ -125,7 +125,7 @@ public class BooksMediaLibraryItemDeletionStrategyTests
|
||||
Result<Success> result = await _sut.DeleteItemAsync(libraryId.Value, book.Path, CancellationToken.None);
|
||||
|
||||
// Assert
|
||||
// a failing artwork deletion must not prevent the book from being removed, so the deletion is only logged
|
||||
// A failing artwork deletion must not prevent the book from being removed, so the deletion is only logged.
|
||||
Assert.True(result.IsSuccess);
|
||||
await _mockBookRepository.Received(1).DeleteByIdAsync(book.Id, Arg.Any<CancellationToken>());
|
||||
await _mockUnitOfWork.Received(1).SaveChangesAsync(Arg.Any<CancellationToken>());
|
||||
|
||||
+1
-1
@@ -76,7 +76,7 @@ public class LibraryDeletedDomainEventHandlerTests
|
||||
IOptions<MediaSettingsDto> mediaSettingsOptions = Substitute.For<IOptions<MediaSettingsDto>>();
|
||||
mediaSettingsOptions.Value.Returns(mediaSettings);
|
||||
|
||||
// default stubs: all path combinations succeed, segments are sanitized to their input, the library directories exist and they are deleted successfully
|
||||
// Default stubs: all path combinations succeed, segments are sanitized to their input, the library directories exist and they are deleted successfully.
|
||||
_mockPathService.CombinePath(Arg.Any<string>(), Arg.Any<string>())
|
||||
.Returns(callInfo => Result.From(string.Concat(callInfo.ArgAt<string>(0), callInfo.ArgAt<string>(1))));
|
||||
_mockPathService.SanitizeCompositeSegment(Arg.Any<string>(), Arg.Any<string>())
|
||||
|
||||
+3
-3
@@ -74,7 +74,7 @@ public class LibrarySavedDomainEventHandlerTests
|
||||
IOptions<MediaSettingsDto> mediaSettingsOptions = Substitute.For<IOptions<MediaSettingsDto>>();
|
||||
mediaSettingsOptions.Value.Returns(mediaSettings);
|
||||
|
||||
// default stubs: the cover source file exists and is a valid image, the library directory does not exist yet, and all path combinations succeed
|
||||
// Default stubs: the cover source file exists and is a valid image, the library directory does not exist yet, and all path combinations succeed.
|
||||
_mockPathService.PathSeparator.Returns('/');
|
||||
_mockPathService.CombinePath(Arg.Any<string>(), Arg.Any<string>())
|
||||
.Returns(callInfo => Result.From(string.Concat(callInfo.ArgAt<string>(0), callInfo.ArgAt<string>(1))));
|
||||
@@ -166,8 +166,8 @@ public class LibrarySavedDomainEventHandlerTests
|
||||
Guid libraryId = Guid.NewGuid();
|
||||
Library library = _libraryFixture.Create(id: libraryId, coverImage: "/Media/Libraries/guid/cover.png");
|
||||
LibrarySavedDomainEvent domainEvent = _librarySavedDomainEventFixture.Create(library: library);
|
||||
// mirror the real CombinePath behavior, which treats the combined name as a directory segment and appends a trailing
|
||||
// separator; the internal cover path resolution must still yield the file path without that trailing separator
|
||||
// Mirror the real CombinePath behavior, which treats the combined name as a directory segment and appends a trailing
|
||||
// separator; the internal cover path resolution must still yield the file path without that trailing separator.
|
||||
_mockPathService.CombinePath(Arg.Any<string>(), Arg.Any<string>())
|
||||
.Returns(callInfo => Result.From(string.Concat(callInfo.ArgAt<string>(0), callInfo.ArgAt<string>(1)) + '/'));
|
||||
string internalImagePath = $"{AppContext.BaseDirectory.TrimEnd('/')}/Media/Libraries/guid/cover.png";
|
||||
|
||||
+1
-1
@@ -59,7 +59,7 @@ public class LibraryScanFailedDomainEventHandlerTests
|
||||
_mockMediaLibrariesScanCancellationTracker = Substitute.For<IMediaLibrariesScanCancellationTracker>();
|
||||
_mockDebouncedLibraryScanProgressNotifier = Substitute.For<IMediaLibraryScanProgressNotifier>();
|
||||
|
||||
// default stubs: the library scan update, the snapshot rollback and the staging results clearing succeed
|
||||
// Default stubs: the library scan update, the snapshot rollback and the staging results clearing succeed.
|
||||
_mockLibraryScanRepository.UpdateAsync(Arg.Any<LibraryScanEntity>(), Arg.Any<CancellationToken>())
|
||||
.Returns(Result.Updated);
|
||||
_mockLibraryScanSnapshotRepository.RollbackSnapshotForScanAsync(Arg.Any<Guid>(), Arg.Any<Guid>(), Arg.Any<CancellationToken>())
|
||||
|
||||
+1
-1
@@ -53,7 +53,7 @@ public class LibraryScanFinishedDomainEventHandlerTests
|
||||
_mockMediaLibrariesScanCancellationTracker = Substitute.For<IMediaLibrariesScanCancellationTracker>();
|
||||
_mockDebouncedLibraryScanProgressNotifier = Substitute.For<IMediaLibraryScanProgressNotifier>();
|
||||
|
||||
// default stubs: the library scan update succeeds
|
||||
// Default stubs: the library scan update succeeds.
|
||||
_mockLibraryScanRepository.UpdateAsync(Arg.Any<LibraryScanEntity>(), Arg.Any<CancellationToken>())
|
||||
.Returns(Result.Updated);
|
||||
|
||||
|
||||
+1
-1
@@ -48,7 +48,7 @@ public class GetEnabledLibrariesQueryHandlerTests
|
||||
_mockCurrentUserService = Substitute.For<ICurrentUserService>();
|
||||
_userId = Guid.NewGuid();
|
||||
|
||||
// default stubs: the current user is authenticated and is an admin
|
||||
// Default stubs: the current user is authenticated and is an admin.
|
||||
_mockCurrentUserService.UserId.Returns(_userId);
|
||||
_mockAuthorizationService.IsInRoleAsync(_userId, "Admin", Arg.Any<CancellationToken>()).Returns(true);
|
||||
|
||||
|
||||
+1
-1
@@ -52,7 +52,7 @@ public class GetLibrariesQueryHandlerTests
|
||||
_mockCurrentUserService = Substitute.For<ICurrentUserService>();
|
||||
_userId = Guid.NewGuid();
|
||||
|
||||
// default stubs: the current user is authenticated and is an admin
|
||||
// Default stubs: the current user is authenticated and is an admin.
|
||||
_mockCurrentUserService.UserId.Returns(_userId);
|
||||
_mockAuthorizationService.IsInRoleAsync(_userId, "Admin", Arg.Any<CancellationToken>()).Returns(true);
|
||||
|
||||
|
||||
+1
-1
@@ -54,7 +54,7 @@ public class GetLibraryQueryHandlerTests
|
||||
_mockValidator = Substitute.For<IValidator<GetLibraryQuery>>();
|
||||
_userId = Guid.NewGuid();
|
||||
|
||||
// default stubs: the current user is authenticated and the library ownership policy allows access
|
||||
// Default stubs: the current user is authenticated and the library ownership policy allows access.
|
||||
_mockCurrentUserService.UserId.Returns(_userId);
|
||||
_mockAuthorizationService.EvaluatePolicyAsync<ILibraryOwnershipPolicy>(_userId, Arg.Any<LibraryOwnershipPolicyContext>(), Arg.Any<CancellationToken>())
|
||||
.Returns(true);
|
||||
|
||||
+1
-1
@@ -62,7 +62,7 @@ public class GetLibraryScanProgressQueryHandlerTests
|
||||
_mockValidator = Substitute.For<IValidator<GetLibraryScanProgressQuery>>();
|
||||
_userId = Guid.NewGuid();
|
||||
|
||||
// default stubs: the current user is authenticated, the ownership policy allows access, and the scan has progress
|
||||
// Default stubs: the current user is authenticated, the ownership policy allows access, and the scan has progress.
|
||||
_mockCurrentUserService.UserId.Returns(_userId);
|
||||
_mockAuthorizationService.EvaluatePolicyAsync<ILibraryOwnershipPolicy>(_userId, Arg.Any<LibraryOwnershipPolicyContext>(), Arg.Any<CancellationToken>())
|
||||
.Returns(true);
|
||||
|
||||
+10
-10
@@ -21,11 +21,11 @@ public class DeleteBookCommandValidatorTests
|
||||
private readonly DeleteBookCommandValidator _validator = new();
|
||||
|
||||
[Theory]
|
||||
[InlineData(null)] // missing route value
|
||||
[InlineData("")] // empty route value
|
||||
[InlineData(" ")] // whitespace route value, which both the not empty rule and the format rule reject
|
||||
[InlineData("not-a-library-guid")] // non-Guid route value
|
||||
[InlineData("00000000-0000-0000-0000-000000000000")] // empty Guid route value
|
||||
[InlineData(null)] // Missing route value.
|
||||
[InlineData("")] // Empty route value.
|
||||
[InlineData(" ")] // Whitespace route value, which both the not empty rule and the format rule reject.
|
||||
[InlineData("not-a-library-guid")] // Non-Guid route value.
|
||||
[InlineData("00000000-0000-0000-0000-000000000000")] // Empty Guid route value.
|
||||
public void Validate_WhenLibraryIdIsEmptyOrInvalid_ShouldHaveValidationError(string? libraryId)
|
||||
{
|
||||
// Arrange
|
||||
@@ -39,11 +39,11 @@ public class DeleteBookCommandValidatorTests
|
||||
}
|
||||
|
||||
[Theory]
|
||||
[InlineData(null)] // missing route value
|
||||
[InlineData("")] // empty route value
|
||||
[InlineData(" ")] // whitespace route value, which both the not empty rule and the format rule reject
|
||||
[InlineData("not-a-book-guid")] // non-Guid route value
|
||||
[InlineData("00000000-0000-0000-0000-000000000000")] // empty Guid route value
|
||||
[InlineData(null)] // Missing route value.
|
||||
[InlineData("")] // Empty route value.
|
||||
[InlineData(" ")] // Whitespace route value, which both the not empty rule and the format rule reject.
|
||||
[InlineData("not-a-book-guid")] // Non-Guid route value.
|
||||
[InlineData("00000000-0000-0000-0000-000000000000")] // Empty Guid route value.
|
||||
public void Validate_WhenBookIdIsEmptyOrInvalid_ShouldHaveValidationError(string? bookId)
|
||||
{
|
||||
// Arrange
|
||||
|
||||
+10
-10
@@ -21,11 +21,11 @@ public class RestoreBookCommandValidatorTests
|
||||
private readonly RestoreBookCommandValidator _validator = new();
|
||||
|
||||
[Theory]
|
||||
[InlineData(null)] // missing route value
|
||||
[InlineData("")] // empty route value
|
||||
[InlineData(" ")] // whitespace route value, which both the not empty rule and the format rule reject
|
||||
[InlineData("not-a-library-guid")] // non-Guid route value
|
||||
[InlineData("00000000-0000-0000-0000-000000000000")] // empty Guid route value
|
||||
[InlineData(null)] // Missing route value.
|
||||
[InlineData("")] // Empty route value.
|
||||
[InlineData(" ")] // Whitespace route value, which both the not empty rule and the format rule reject.
|
||||
[InlineData("not-a-library-guid")] // Non-Guid route value.
|
||||
[InlineData("00000000-0000-0000-0000-000000000000")] // Empty Guid route value.
|
||||
public void Validate_WhenLibraryIdIsEmptyOrInvalid_ShouldHaveValidationError(string? libraryId)
|
||||
{
|
||||
// Arrange
|
||||
@@ -39,11 +39,11 @@ public class RestoreBookCommandValidatorTests
|
||||
}
|
||||
|
||||
[Theory]
|
||||
[InlineData(null)] // missing route value
|
||||
[InlineData("")] // empty route value
|
||||
[InlineData(" ")] // whitespace route value, which both the not empty rule and the format rule reject
|
||||
[InlineData("not-a-book-guid")] // non-Guid route value
|
||||
[InlineData("00000000-0000-0000-0000-000000000000")] // empty Guid route value
|
||||
[InlineData(null)] // Missing route value.
|
||||
[InlineData("")] // Empty route value.
|
||||
[InlineData(" ")] // Whitespace route value, which both the not empty rule and the format rule reject.
|
||||
[InlineData("not-a-book-guid")] // Non-Guid route value.
|
||||
[InlineData("00000000-0000-0000-0000-000000000000")] // Empty Guid route value.
|
||||
public void Validate_WhenBookIdIsEmptyOrInvalid_ShouldHaveValidationError(string? bookId)
|
||||
{
|
||||
// Arrange
|
||||
|
||||
+8
-8
@@ -34,10 +34,10 @@ public class GetBookQueryValidatorTests
|
||||
}
|
||||
|
||||
[Theory]
|
||||
[InlineData(null)] // missing route value
|
||||
[InlineData("")] // empty route value
|
||||
[InlineData("not-a-library-guid")] // non-Guid route value
|
||||
[InlineData("00000000-0000-0000-0000-000000000000")] // empty Guid route value
|
||||
[InlineData(null)] // Missing route value.
|
||||
[InlineData("")] // Empty route value.
|
||||
[InlineData("not-a-library-guid")] // Non-Guid route value.
|
||||
[InlineData("00000000-0000-0000-0000-000000000000")] // Empty Guid route value.
|
||||
public void Validate_WhenLibraryIdIsEmptyOrInvalid_ShouldHaveValidationError(string? libraryId)
|
||||
{
|
||||
// Arrange
|
||||
@@ -51,10 +51,10 @@ public class GetBookQueryValidatorTests
|
||||
}
|
||||
|
||||
[Theory]
|
||||
[InlineData(null)] // missing route value
|
||||
[InlineData("")] // empty route value
|
||||
[InlineData("not-a-guid")] // non-Guid route value
|
||||
[InlineData("00000000-0000-0000-0000-000000000000")] // empty Guid route value
|
||||
[InlineData(null)] // Missing route value.
|
||||
[InlineData("")] // Empty route value.
|
||||
[InlineData("not-a-guid")] // Non-Guid route value.
|
||||
[InlineData("00000000-0000-0000-0000-000000000000")] // Empty Guid route value.
|
||||
public void Validate_WhenBookIdIsEmptyOrInvalid_ShouldHaveValidationError(string? bookId)
|
||||
{
|
||||
// Arrange
|
||||
|
||||
+1
-1
@@ -59,7 +59,7 @@ public class GetBooksQueryHandlerTests
|
||||
_mockValidator = Substitute.For<IValidator<GetBooksQuery>>();
|
||||
_userId = Guid.NewGuid();
|
||||
|
||||
// default stubs: the current user is authenticated and the library ownership policy allows access
|
||||
// Default stubs: the current user is authenticated and the library ownership policy allows access.
|
||||
_mockCurrentUserService.UserId.Returns(_userId);
|
||||
_mockAuthorizationService.EvaluatePolicyAsync<ILibraryOwnershipPolicy>(_userId, Arg.Any<LibraryOwnershipPolicyContext>(), Arg.Any<CancellationToken>())
|
||||
.Returns(true);
|
||||
|
||||
+1
-1
@@ -59,7 +59,7 @@ public class GetBooksLiteQueryHandlerTests
|
||||
_mockValidator = Substitute.For<IValidator<GetBooksLiteQuery>>();
|
||||
_userId = Guid.NewGuid();
|
||||
|
||||
// default stubs: the current user is authenticated and the library ownership policy allows access
|
||||
// Default stubs: the current user is authenticated and the library ownership policy allows access.
|
||||
_mockCurrentUserService.UserId.Returns(_userId);
|
||||
_mockAuthorizationService.EvaluatePolicyAsync<ILibraryOwnershipPolicy>(_userId, Arg.Any<LibraryOwnershipPolicyContext>(), Arg.Any<CancellationToken>())
|
||||
.Returns(true);
|
||||
|
||||
+5
-5
@@ -21,11 +21,11 @@ public class GetDeletedBooksQueryValidatorTests
|
||||
private readonly GetDeletedBooksQueryValidator _validator = new();
|
||||
|
||||
[Theory]
|
||||
[InlineData(null)] // missing route value
|
||||
[InlineData("")] // empty route value
|
||||
[InlineData(" ")] // whitespace route value, which both the not empty rule and the format rule reject
|
||||
[InlineData("not-a-library-guid")] // non-Guid route value
|
||||
[InlineData("00000000-0000-0000-0000-000000000000")] // empty Guid route value
|
||||
[InlineData(null)] // Missing route value.
|
||||
[InlineData("")] // Empty route value.
|
||||
[InlineData(" ")] // Whitespace route value, which both the not empty rule and the format rule reject.
|
||||
[InlineData("not-a-library-guid")] // Non-Guid route value.
|
||||
[InlineData("00000000-0000-0000-0000-000000000000")] // Empty Guid route value.
|
||||
public void Validate_WhenLibraryIdIsEmptyOrInvalid_ShouldHaveValidationError(string? libraryId)
|
||||
{
|
||||
// Arrange
|
||||
|
||||
+8
-8
@@ -34,10 +34,10 @@ public class GetReadingAvailabilityQueryValidatorTests
|
||||
}
|
||||
|
||||
[Theory]
|
||||
[InlineData(null)] // missing route value
|
||||
[InlineData("")] // empty route value
|
||||
[InlineData("not-a-library-guid")] // non-Guid route value
|
||||
[InlineData("00000000-0000-0000-0000-000000000000")] // empty Guid route value
|
||||
[InlineData(null)] // Missing route value.
|
||||
[InlineData("")] // Empty route value.
|
||||
[InlineData("not-a-library-guid")] // Non-Guid route value.
|
||||
[InlineData("00000000-0000-0000-0000-000000000000")] // Empty Guid route value.
|
||||
public void Validate_WhenLibraryIdIsEmptyOrInvalid_ShouldHaveValidationError(string? libraryId)
|
||||
{
|
||||
// Arrange
|
||||
@@ -51,10 +51,10 @@ public class GetReadingAvailabilityQueryValidatorTests
|
||||
}
|
||||
|
||||
[Theory]
|
||||
[InlineData(null)] // missing route value
|
||||
[InlineData("")] // empty route value
|
||||
[InlineData("not-a-guid")] // non-Guid route value
|
||||
[InlineData("00000000-0000-0000-0000-000000000000")] // empty Guid route value
|
||||
[InlineData(null)] // Missing route value.
|
||||
[InlineData("")] // Empty route value.
|
||||
[InlineData("not-a-guid")] // Non-Guid route value.
|
||||
[InlineData("00000000-0000-0000-0000-000000000000")] // Empty Guid route value.
|
||||
public void Validate_WhenBookIdIsEmptyOrInvalid_ShouldHaveValidationError(string? bookId)
|
||||
{
|
||||
// Arrange
|
||||
|
||||
+8
-8
@@ -34,10 +34,10 @@ public class GetReadingManifestQueryValidatorTests
|
||||
}
|
||||
|
||||
[Theory]
|
||||
[InlineData(null)] // missing route value
|
||||
[InlineData("")] // empty route value
|
||||
[InlineData("not-a-library-guid")] // non-Guid route value
|
||||
[InlineData("00000000-0000-0000-0000-000000000000")] // empty Guid route value
|
||||
[InlineData(null)] // Missing route value.
|
||||
[InlineData("")] // Empty route value.
|
||||
[InlineData("not-a-library-guid")] // Non-Guid route value.
|
||||
[InlineData("00000000-0000-0000-0000-000000000000")] // Empty Guid route value.
|
||||
public void Validate_WhenLibraryIdIsEmptyOrInvalid_ShouldHaveValidationError(string? libraryId)
|
||||
{
|
||||
// Arrange
|
||||
@@ -51,10 +51,10 @@ public class GetReadingManifestQueryValidatorTests
|
||||
}
|
||||
|
||||
[Theory]
|
||||
[InlineData(null)] // missing route value
|
||||
[InlineData("")] // empty route value
|
||||
[InlineData("not-a-guid")] // non-Guid route value
|
||||
[InlineData("00000000-0000-0000-0000-000000000000")] // empty Guid route value
|
||||
[InlineData(null)] // Missing route value.
|
||||
[InlineData("")] // Empty route value.
|
||||
[InlineData("not-a-guid")] // Non-Guid route value.
|
||||
[InlineData("00000000-0000-0000-0000-000000000000")] // Empty Guid route value.
|
||||
public void Validate_WhenBookIdIsEmptyOrInvalid_ShouldHaveValidationError(string? bookId)
|
||||
{
|
||||
// Arrange
|
||||
|
||||
+1
-1
@@ -73,7 +73,7 @@ public class GetReadingResourceQueryHandlerTests
|
||||
_mockValidator = Substitute.For<IValidator<GetReadingResourceQuery>>();
|
||||
_userId = Guid.NewGuid();
|
||||
|
||||
// default stubs: the current user is authenticated and the library ownership policy allows access
|
||||
// Default stubs: the current user is authenticated and the library ownership policy allows access.
|
||||
_mockCurrentUserService.UserId.Returns(_userId);
|
||||
_mockAuthorizationService.EvaluatePolicyAsync<ILibraryOwnershipPolicy>(_userId, Arg.Any<LibraryOwnershipPolicyContext>(), Arg.Any<CancellationToken>())
|
||||
.Returns(true);
|
||||
|
||||
+10
-10
@@ -35,10 +35,10 @@ public class GetReadingResourceQueryValidatorTests
|
||||
}
|
||||
|
||||
[Theory]
|
||||
[InlineData(null)] // missing route value
|
||||
[InlineData("")] // empty route value
|
||||
[InlineData("not-a-library-guid")] // non-Guid route value
|
||||
[InlineData("00000000-0000-0000-0000-000000000000")] // empty Guid route value
|
||||
[InlineData(null)] // Missing route value.
|
||||
[InlineData("")] // Empty route value.
|
||||
[InlineData("not-a-library-guid")] // Non-Guid route value.
|
||||
[InlineData("00000000-0000-0000-0000-000000000000")] // Empty Guid route value.
|
||||
public void Validate_WhenLibraryIdIsEmptyOrInvalid_ShouldHaveValidationError(string? libraryId)
|
||||
{
|
||||
// Arrange
|
||||
@@ -52,10 +52,10 @@ public class GetReadingResourceQueryValidatorTests
|
||||
}
|
||||
|
||||
[Theory]
|
||||
[InlineData(null)] // missing route value
|
||||
[InlineData("")] // empty route value
|
||||
[InlineData("not-a-guid")] // non-Guid route value
|
||||
[InlineData("00000000-0000-0000-0000-000000000000")] // empty Guid route value
|
||||
[InlineData(null)] // Missing route value.
|
||||
[InlineData("")] // Empty route value.
|
||||
[InlineData("not-a-guid")] // Non-Guid route value.
|
||||
[InlineData("00000000-0000-0000-0000-000000000000")] // Empty Guid route value.
|
||||
public void Validate_WhenBookIdIsEmptyOrInvalid_ShouldHaveValidationError(string? bookId)
|
||||
{
|
||||
// Arrange
|
||||
@@ -69,8 +69,8 @@ public class GetReadingResourceQueryValidatorTests
|
||||
}
|
||||
|
||||
[Theory]
|
||||
[InlineData(null)] // missing route value
|
||||
[InlineData("")] // empty route value
|
||||
[InlineData(null)] // Missing route value.
|
||||
[InlineData("")] // Empty route value.
|
||||
public void Validate_WhenResourceKeyIsEmpty_ShouldHaveValidationError(string? resourceKey)
|
||||
{
|
||||
// Arrange
|
||||
|
||||
+3
-3
@@ -73,7 +73,7 @@ public class GetReadingSectionQueryHandlerTests
|
||||
_mockValidator = Substitute.For<IValidator<GetReadingSectionQuery>>();
|
||||
_userId = Guid.NewGuid();
|
||||
|
||||
// default stubs: the current user is authenticated and the library ownership policy allows access
|
||||
// Default stubs: the current user is authenticated and the library ownership policy allows access.
|
||||
_mockCurrentUserService.UserId.Returns(_userId);
|
||||
_mockAuthorizationService.EvaluatePolicyAsync<ILibraryOwnershipPolicy>(_userId, Arg.Any<LibraryOwnershipPolicyContext>(), Arg.Any<CancellationToken>())
|
||||
.Returns(true);
|
||||
@@ -132,8 +132,8 @@ public class GetReadingSectionQueryHandlerTests
|
||||
}
|
||||
|
||||
[Theory]
|
||||
[InlineData(true)] // the user chose to preserve the styles of the books
|
||||
[InlineData(false)] // the user chose to strip the styles of the books
|
||||
[InlineData(true)] // The user chose to preserve the styles of the books.
|
||||
[InlineData(false)] // The user chose to strip the styles of the books.
|
||||
public async Task HandleAsync_WhenUserHasPreserveBookStylesSetting_ShouldPassItToTheService(bool shouldPreserveBookStyles)
|
||||
{
|
||||
// Arrange
|
||||
|
||||
+10
-10
@@ -35,10 +35,10 @@ public class GetReadingSectionQueryValidatorTests
|
||||
}
|
||||
|
||||
[Theory]
|
||||
[InlineData(null)] // missing route value
|
||||
[InlineData("")] // empty route value
|
||||
[InlineData("not-a-library-guid")] // non-Guid route value
|
||||
[InlineData("00000000-0000-0000-0000-000000000000")] // empty Guid route value
|
||||
[InlineData(null)] // Missing route value.
|
||||
[InlineData("")] // Empty route value.
|
||||
[InlineData("not-a-library-guid")] // Non-Guid route value.
|
||||
[InlineData("00000000-0000-0000-0000-000000000000")] // Empty Guid route value.
|
||||
public void Validate_WhenLibraryIdIsEmptyOrInvalid_ShouldHaveValidationError(string? libraryId)
|
||||
{
|
||||
// Arrange
|
||||
@@ -52,10 +52,10 @@ public class GetReadingSectionQueryValidatorTests
|
||||
}
|
||||
|
||||
[Theory]
|
||||
[InlineData(null)] // missing route value
|
||||
[InlineData("")] // empty route value
|
||||
[InlineData("not-a-guid")] // non-Guid route value
|
||||
[InlineData("00000000-0000-0000-0000-000000000000")] // empty Guid route value
|
||||
[InlineData(null)] // Missing route value.
|
||||
[InlineData("")] // Empty route value.
|
||||
[InlineData("not-a-guid")] // Non-Guid route value.
|
||||
[InlineData("00000000-0000-0000-0000-000000000000")] // Empty Guid route value.
|
||||
public void Validate_WhenBookIdIsEmptyOrInvalid_ShouldHaveValidationError(string? bookId)
|
||||
{
|
||||
// Arrange
|
||||
@@ -69,8 +69,8 @@ public class GetReadingSectionQueryValidatorTests
|
||||
}
|
||||
|
||||
[Theory]
|
||||
[InlineData(null)] // missing route value
|
||||
[InlineData("")] // empty route value
|
||||
[InlineData(null)] // Missing route value.
|
||||
[InlineData("")] // Empty route value.
|
||||
public void Validate_WhenLocationRefIsEmpty_ShouldHaveValidationError(string? locationRef)
|
||||
{
|
||||
// Arrange
|
||||
|
||||
Reference in new issue
Block a user