mirror of
https://github.com/BinaryAlley/Nemera.git
synced 2026-12-03 12: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
+7
-7
@@ -117,9 +117,9 @@ public class AddFavoriteCommandHandlerTests
|
||||
}
|
||||
|
||||
[Theory]
|
||||
[InlineData(FavoriteMediaKind.None)] // the default value, which is not a kind that can be favorited
|
||||
[InlineData(FavoriteMediaKind.Video)] // video libraries are not catalogued yet
|
||||
[InlineData(FavoriteMediaKind.Photo)] // photo libraries are not catalogued yet
|
||||
[InlineData(FavoriteMediaKind.None)] // The default value, which is not a kind that can be favorited.
|
||||
[InlineData(FavoriteMediaKind.Video)] // Video libraries are not catalogued yet.
|
||||
[InlineData(FavoriteMediaKind.Photo)] // Photo libraries are not catalogued yet.
|
||||
public async Task HandleAsync_WhenMediaKindIsNotSupported_ShouldReturnNotSupportedAndNotResolveTheLibrary(FavoriteMediaKind mediaKind)
|
||||
{
|
||||
// Arrange
|
||||
@@ -156,10 +156,10 @@ public class AddFavoriteCommandHandlerTests
|
||||
}
|
||||
|
||||
[Theory]
|
||||
[InlineData(FavoriteMediaKind.MusicArtist, nameof(DomainErrors.Music.ArtistNotFound))] // the artist does not exist
|
||||
[InlineData(FavoriteMediaKind.MusicAlbum, nameof(DomainErrors.Music.AlbumNotFound))] // the album does not exist
|
||||
[InlineData(FavoriteMediaKind.MusicTrack, nameof(DomainErrors.Music.TrackNotFound))] // the track does not exist
|
||||
[InlineData(FavoriteMediaKind.Book, nameof(DomainErrors.WrittenContent.BookNotFound))] // the book does not exist
|
||||
[InlineData(FavoriteMediaKind.MusicArtist, nameof(DomainErrors.Music.ArtistNotFound))] // The artist does not exist.
|
||||
[InlineData(FavoriteMediaKind.MusicAlbum, nameof(DomainErrors.Music.AlbumNotFound))] // The album does not exist.
|
||||
[InlineData(FavoriteMediaKind.MusicTrack, nameof(DomainErrors.Music.TrackNotFound))] // The track does not exist.
|
||||
[InlineData(FavoriteMediaKind.Book, nameof(DomainErrors.WrittenContent.BookNotFound))] // The book does not exist.
|
||||
public async Task HandleAsync_WhenTheMediaItemHasNoLibrary_ShouldReturnTheMediaKindSpecificNotFoundError(FavoriteMediaKind mediaKind, string expectedErrorDescription)
|
||||
{
|
||||
// Arrange
|
||||
|
||||
+6
-6
@@ -61,12 +61,12 @@ public class AddFavoriteCommandValidatorTests
|
||||
}
|
||||
|
||||
[Theory]
|
||||
[InlineData(FavoriteMediaKind.MusicArtist)] // a catalogued music kind
|
||||
[InlineData(FavoriteMediaKind.MusicAlbum)] // a catalogued music kind
|
||||
[InlineData(FavoriteMediaKind.MusicTrack)] // a catalogued music kind
|
||||
[InlineData(FavoriteMediaKind.Book)] // a catalogued written content kind
|
||||
[InlineData(FavoriteMediaKind.Video)] // a planned kind is still a defined enumeration member
|
||||
[InlineData(FavoriteMediaKind.Photo)] // a planned kind is still a defined enumeration member
|
||||
[InlineData(FavoriteMediaKind.MusicArtist)] // A catalogued music kind.
|
||||
[InlineData(FavoriteMediaKind.MusicAlbum)] // A catalogued music kind.
|
||||
[InlineData(FavoriteMediaKind.MusicTrack)] // A catalogued music kind.
|
||||
[InlineData(FavoriteMediaKind.Book)] // A catalogued written content kind.
|
||||
[InlineData(FavoriteMediaKind.Video)] // A planned kind is still a defined enumeration member.
|
||||
[InlineData(FavoriteMediaKind.Photo)] // A planned kind is still a defined enumeration member.
|
||||
public void Validate_WhenMediaKindIsDefined_ShouldNotHaveValidationError(FavoriteMediaKind mediaKind)
|
||||
{
|
||||
// Arrange
|
||||
|
||||
+15
-15
@@ -34,15 +34,15 @@ public class RemoveFavoriteCommandValidatorTests
|
||||
}
|
||||
|
||||
[Theory]
|
||||
[InlineData("")] // the media kind is empty
|
||||
[InlineData(" ")] // the media kind is whitespace only
|
||||
[InlineData("Hologram")] // the media kind is not a member of the enumeration
|
||||
[InlineData("None")] // the default value is not a kind that can be favorited
|
||||
[InlineData("none")] // the default value, matched case insensitively
|
||||
[InlineData("0")] // the media kind is a numeric route value, which the validator rejects by name
|
||||
[InlineData("1")] // a numeric route value that parses to a defined member, which the name check rejects
|
||||
[InlineData("MusicTrack,Book")] // a comma separated list is not a single member name
|
||||
[InlineData("../MusicTrack")] // a path-like value is not a member name
|
||||
[InlineData("")] // The media kind is empty.
|
||||
[InlineData(" ")] // The media kind is whitespace only.
|
||||
[InlineData("Hologram")] // The media kind is not a member of the enumeration.
|
||||
[InlineData("None")] // The default value is not a kind that can be favorited.
|
||||
[InlineData("none")] // The default value, matched case insensitively.
|
||||
[InlineData("0")] // The media kind is a numeric route value, which the validator rejects by name.
|
||||
[InlineData("1")] // A numeric route value that parses to a defined member, which the name check rejects.
|
||||
[InlineData("MusicTrack,Book")] // A comma separated list is not a single member name.
|
||||
[InlineData("../MusicTrack")] // A path-like value is not a member name.
|
||||
public void Validate_WhenMediaKindIsEmptyOrNotAMemberName_ShouldHaveValidationError(string mediaKind)
|
||||
{
|
||||
// Arrange
|
||||
@@ -56,8 +56,8 @@ public class RemoveFavoriteCommandValidatorTests
|
||||
}
|
||||
|
||||
[Theory]
|
||||
[InlineData("musictrack")] // the member name is lower case
|
||||
[InlineData("BoOk")] // the member name is mixed case
|
||||
[InlineData("musictrack")] // The member name is lower case.
|
||||
[InlineData("BoOk")] // The member name is mixed case.
|
||||
public void Validate_WhenMediaKindUsesDifferentCasing_ShouldNotHaveValidationError(string mediaKind)
|
||||
{
|
||||
// Arrange
|
||||
@@ -84,10 +84,10 @@ public class RemoveFavoriteCommandValidatorTests
|
||||
}
|
||||
|
||||
[Theory]
|
||||
[InlineData("")] // the media item Id is empty
|
||||
[InlineData(" ")] // the media item Id is whitespace only
|
||||
[InlineData("not-a-guid")] // the media item Id is not a Guid
|
||||
[InlineData("00000000-0000-0000-0000-000000000000")] // the media item Id is the empty Guid
|
||||
[InlineData("")] // The media item Id is empty.
|
||||
[InlineData(" ")] // The media item Id is whitespace only.
|
||||
[InlineData("not-a-guid")] // The media item Id is not a Guid.
|
||||
[InlineData("00000000-0000-0000-0000-000000000000")] // The media item Id is the empty Guid.
|
||||
public void Validate_WhenMediaItemIdIsEmptyOrInvalid_ShouldHaveValidationError(string mediaItemId)
|
||||
{
|
||||
// Arrange
|
||||
|
||||
+6
-6
@@ -61,12 +61,12 @@ public class GetFavoritesQueryValidatorTests
|
||||
}
|
||||
|
||||
[Theory]
|
||||
[InlineData(FavoriteMediaKind.MusicArtist)] // a catalogued music kind
|
||||
[InlineData(FavoriteMediaKind.MusicAlbum)] // a catalogued music kind
|
||||
[InlineData(FavoriteMediaKind.MusicTrack)] // a catalogued music kind
|
||||
[InlineData(FavoriteMediaKind.Book)] // a catalogued written content kind
|
||||
[InlineData(FavoriteMediaKind.Video)] // a planned kind is still a defined enumeration member
|
||||
[InlineData(FavoriteMediaKind.Photo)] // a planned kind is still a defined enumeration member
|
||||
[InlineData(FavoriteMediaKind.MusicArtist)] // A catalogued music kind.
|
||||
[InlineData(FavoriteMediaKind.MusicAlbum)] // A catalogued music kind.
|
||||
[InlineData(FavoriteMediaKind.MusicTrack)] // A catalogued music kind.
|
||||
[InlineData(FavoriteMediaKind.Book)] // A catalogued written content kind.
|
||||
[InlineData(FavoriteMediaKind.Video)] // A planned kind is still a defined enumeration member.
|
||||
[InlineData(FavoriteMediaKind.Photo)] // A planned kind is still a defined enumeration member.
|
||||
public void Validate_WhenMediaKindIsDefined_ShouldNotHaveValidationError(FavoriteMediaKind mediaKind)
|
||||
{
|
||||
// Arrange
|
||||
|
||||
+1
-1
@@ -51,7 +51,7 @@ public class GetPathParentQueryHandlerTests
|
||||
|
||||
IEnumerable<PathSegment> pathSegments = _pathSegmentFixture.CreateMany();
|
||||
|
||||
// Create PathSegmentResponses based on the PathSegments
|
||||
// Create PathSegmentResponses based on the PathSegments.
|
||||
IEnumerable<PathSegmentResponse> pathSegmentResponses = pathSegments.Select(segment => _pathSegmentResponseFixture.Create(path: segment.Name));
|
||||
|
||||
_mockPathService.GoUpOneLevel(query.Path!)
|
||||
|
||||
+10
-10
@@ -160,12 +160,12 @@ public class SetupApplicationCommandValidatorTests
|
||||
}
|
||||
|
||||
[Theory]
|
||||
[InlineData("password123")] // Missing uppercase and special character
|
||||
[InlineData("PASSWORD123")] // Missing special character
|
||||
[InlineData("Password123")] // Missing special character
|
||||
[InlineData("Password!@#")] // Missing number
|
||||
[InlineData("Pass1!")] // Too short
|
||||
[InlineData("password")] // Missing uppercase, number, and special character
|
||||
[InlineData("password123")] // Missing uppercase and special character.
|
||||
[InlineData("PASSWORD123")] // Missing special character.
|
||||
[InlineData("Password123")] // Missing special character.
|
||||
[InlineData("Password!@#")] // Missing number.
|
||||
[InlineData("Pass1!")] // Too short.
|
||||
[InlineData("password")] // Missing uppercase, number, and special character.
|
||||
public void Validate_WhenPasswordDoesNotMatchPattern_ShouldHaveValidationError(string password)
|
||||
{
|
||||
// Arrange
|
||||
@@ -180,10 +180,10 @@ public class SetupApplicationCommandValidatorTests
|
||||
}
|
||||
|
||||
[Theory]
|
||||
[InlineData("Password1!")] // Valid password
|
||||
[InlineData("Complex1@Password")] // Valid password
|
||||
[InlineData("MyP@ssw0rd")] // Valid password
|
||||
[InlineData("Abcd123!@#")] // Valid password
|
||||
[InlineData("Password1!")] // Valid password.
|
||||
[InlineData("Complex1@Password")] // Valid password.
|
||||
[InlineData("MyP@ssw0rd")] // Valid password.
|
||||
[InlineData("Abcd123!@#")] // Valid password.
|
||||
public void Validate_WhenPasswordMatchesPattern_ShouldNotHaveValidationError(string password)
|
||||
{
|
||||
// Arrange
|
||||
|
||||
+4
-4
@@ -33,10 +33,10 @@ public class ClearConsumptionHistoryCommandValidatorTests
|
||||
}
|
||||
|
||||
[Theory]
|
||||
[InlineData("")] // the target user Id is empty
|
||||
[InlineData(" ")] // the target user Id is whitespace only
|
||||
[InlineData("not-a-guid")] // the target user Id is not a Guid
|
||||
[InlineData("00000000-0000-0000-0000-000000000000")] // the target user Id is the empty Guid
|
||||
[InlineData("")] // The target user Id is empty.
|
||||
[InlineData(" ")] // The target user Id is whitespace only.
|
||||
[InlineData("not-a-guid")] // The target user Id is not a Guid.
|
||||
[InlineData("00000000-0000-0000-0000-000000000000")] // The target user Id is the empty Guid.
|
||||
public void Validate_WhenTargetUserIdIsEmptyOrInvalid_ShouldHaveValidationError(string targetUserId)
|
||||
{
|
||||
// Arrange
|
||||
|
||||
+8
-8
@@ -33,10 +33,10 @@ public class ClearResumePointsCommandValidatorTests
|
||||
}
|
||||
|
||||
[Theory]
|
||||
[InlineData("")] // the target user Id is empty
|
||||
[InlineData(" ")] // the target user Id is whitespace only
|
||||
[InlineData("not-a-guid")] // the target user Id is not a Guid
|
||||
[InlineData("00000000-0000-0000-0000-000000000000")] // the target user Id is the empty Guid
|
||||
[InlineData("")] // The target user Id is empty.
|
||||
[InlineData(" ")] // The target user Id is whitespace only.
|
||||
[InlineData("not-a-guid")] // The target user Id is not a Guid.
|
||||
[InlineData("00000000-0000-0000-0000-000000000000")] // The target user Id is the empty Guid.
|
||||
public void Validate_WhenTargetUserIdIsEmptyOrInvalid_ShouldHaveValidationError(string targetUserId)
|
||||
{
|
||||
// Arrange
|
||||
@@ -76,10 +76,10 @@ public class ClearResumePointsCommandValidatorTests
|
||||
}
|
||||
|
||||
[Theory]
|
||||
[InlineData("")] // the library Id is empty
|
||||
[InlineData(" ")] // the library Id is whitespace only
|
||||
[InlineData("not-a-guid")] // the library Id is not a Guid
|
||||
[InlineData("00000000-0000-0000-0000-000000000000")] // the library Id is the empty Guid
|
||||
[InlineData("")] // The library Id is empty.
|
||||
[InlineData(" ")] // The library Id is whitespace only.
|
||||
[InlineData("not-a-guid")] // The library Id is not a Guid.
|
||||
[InlineData("00000000-0000-0000-0000-000000000000")] // The library Id is the empty Guid.
|
||||
public void Validate_WhenLibraryIdIsEmptyOrInvalid_ShouldHaveValidationError(string libraryId)
|
||||
{
|
||||
// Arrange
|
||||
|
||||
+26
-26
@@ -34,10 +34,10 @@ public class CompleteConsumptionCommandValidatorTests
|
||||
}
|
||||
|
||||
[Theory]
|
||||
[InlineData("")] // the consumption record Id is empty
|
||||
[InlineData(" ")] // the consumption record Id is whitespace only
|
||||
[InlineData("not-a-guid")] // the consumption record Id is not a Guid
|
||||
[InlineData("00000000-0000-0000-0000-000000000000")] // the consumption record Id is the empty Guid
|
||||
[InlineData("")] // The consumption record Id is empty.
|
||||
[InlineData(" ")] // The consumption record Id is whitespace only.
|
||||
[InlineData("not-a-guid")] // The consumption record Id is not a Guid.
|
||||
[InlineData("00000000-0000-0000-0000-000000000000")] // The consumption record Id is the empty Guid.
|
||||
public void Validate_WhenConsumptionRecordIdIsEmptyOrInvalid_ShouldHaveValidationError(string consumptionRecordId)
|
||||
{
|
||||
// Arrange
|
||||
@@ -182,8 +182,8 @@ public class CompleteConsumptionCommandValidatorTests
|
||||
}
|
||||
|
||||
[Theory]
|
||||
[InlineData(-1)] // a negative offset cannot describe a position within a media item
|
||||
[InlineData(-0.5)] // a fractional negative offset is rejected the same way
|
||||
[InlineData(-1)] // A negative offset cannot describe a position within a media item.
|
||||
[InlineData(-0.5)] // A fractional negative offset is rejected the same way.
|
||||
public void Validate_WhenPositionKindIsTimeOffsetAndOffsetIsNegative_ShouldHaveValidationError(double timeOffsetInSeconds)
|
||||
{
|
||||
// Arrange
|
||||
@@ -199,9 +199,9 @@ public class CompleteConsumptionCommandValidatorTests
|
||||
}
|
||||
|
||||
[Theory]
|
||||
[InlineData(double.NaN)] // not a number is not a position
|
||||
[InlineData(double.PositiveInfinity)] // an infinite offset is not a position
|
||||
[InlineData(double.NegativeInfinity)] // a negative infinite offset is not a position either
|
||||
[InlineData(double.NaN)] // Not a number is not a position.
|
||||
[InlineData(double.PositiveInfinity)] // An infinite offset is not a position.
|
||||
[InlineData(double.NegativeInfinity)] // A negative infinite offset is not a position either.
|
||||
public void Validate_WhenPositionKindIsTimeOffsetAndOffsetIsNotFinite_ShouldHaveValidationError(double timeOffsetInSeconds)
|
||||
{
|
||||
// Arrange
|
||||
@@ -340,8 +340,8 @@ public class CompleteConsumptionCommandValidatorTests
|
||||
}
|
||||
|
||||
[Theory]
|
||||
[InlineData(-0.1)] // a fraction below zero is not a fraction of the media item
|
||||
[InlineData(1.1)] // a fraction above one is not a fraction of the media item
|
||||
[InlineData(-0.1)] // A fraction below zero is not a fraction of the media item.
|
||||
[InlineData(1.1)] // A fraction above one is not a fraction of the media item.
|
||||
public void Validate_WhenProgressFractionIsOutsideItsRange_ShouldHaveValidationError(double progressFraction)
|
||||
{
|
||||
// Arrange
|
||||
@@ -355,9 +355,9 @@ public class CompleteConsumptionCommandValidatorTests
|
||||
}
|
||||
|
||||
[Theory]
|
||||
[InlineData(double.NaN)] // not a number is not a fraction
|
||||
[InlineData(double.PositiveInfinity)] // an infinite fraction is not a fraction
|
||||
[InlineData(double.NegativeInfinity)] // a negative infinite fraction is not a fraction
|
||||
[InlineData(double.NaN)] // Not a number is not a fraction.
|
||||
[InlineData(double.PositiveInfinity)] // An infinite fraction is not a fraction.
|
||||
[InlineData(double.NegativeInfinity)] // A negative infinite fraction is not a fraction.
|
||||
public void Validate_WhenProgressFractionIsNotFinite_ShouldHaveValidationError(double progressFraction)
|
||||
{
|
||||
// Arrange
|
||||
@@ -371,9 +371,9 @@ public class CompleteConsumptionCommandValidatorTests
|
||||
}
|
||||
|
||||
[Theory]
|
||||
[InlineData(0)] // the start of the media item is a valid fraction
|
||||
[InlineData(0.5)] // a fraction in between the boundaries is valid
|
||||
[InlineData(1)] // the end of the media item is a valid fraction
|
||||
[InlineData(0)] // The start of the media item is a valid fraction.
|
||||
[InlineData(0.5)] // A fraction in between the boundaries is valid.
|
||||
[InlineData(1)] // The end of the media item is a valid fraction.
|
||||
public void Validate_WhenProgressFractionIsWithinItsRange_ShouldNotHaveValidationError(double progressFraction)
|
||||
{
|
||||
// Arrange
|
||||
@@ -400,8 +400,8 @@ public class CompleteConsumptionCommandValidatorTests
|
||||
}
|
||||
|
||||
[Theory]
|
||||
[InlineData(-1)] // a negative duration cannot describe consumed time
|
||||
[InlineData(-0.5)] // a fractional negative duration is rejected the same way
|
||||
[InlineData(-1)] // A negative duration cannot describe consumed time.
|
||||
[InlineData(-0.5)] // A fractional negative duration is rejected the same way.
|
||||
public void Validate_WhenConsumedDurationIsNegative_ShouldHaveValidationError(double consumedDurationInSeconds)
|
||||
{
|
||||
// Arrange
|
||||
@@ -415,9 +415,9 @@ public class CompleteConsumptionCommandValidatorTests
|
||||
}
|
||||
|
||||
[Theory]
|
||||
[InlineData(double.NaN)] // not a number is not a duration
|
||||
[InlineData(double.PositiveInfinity)] // an infinite duration is not a duration
|
||||
[InlineData(double.NegativeInfinity)] // a negative infinite duration is not a duration
|
||||
[InlineData(double.NaN)] // Not a number is not a duration.
|
||||
[InlineData(double.PositiveInfinity)] // An infinite duration is not a duration.
|
||||
[InlineData(double.NegativeInfinity)] // A negative infinite duration is not a duration.
|
||||
public void Validate_WhenConsumedDurationIsNotFinite_ShouldHaveValidationError(double consumedDurationInSeconds)
|
||||
{
|
||||
// Arrange
|
||||
@@ -444,8 +444,8 @@ public class CompleteConsumptionCommandValidatorTests
|
||||
}
|
||||
|
||||
[Theory]
|
||||
[InlineData(0)] // a session that consumed no time is valid
|
||||
[InlineData(2_678_400)] // exactly the maximum accepted duration is valid
|
||||
[InlineData(0)] // A session that consumed no time is valid.
|
||||
[InlineData(2_678_400)] // Exactly the maximum accepted duration is valid.
|
||||
public void Validate_WhenConsumedDurationIsWithinItsRange_ShouldNotHaveValidationError(double consumedDurationInSeconds)
|
||||
{
|
||||
// Arrange
|
||||
@@ -486,8 +486,8 @@ public class CompleteConsumptionCommandValidatorTests
|
||||
}
|
||||
|
||||
[Theory]
|
||||
[InlineData(0)] // no pages read is still a valid count
|
||||
[InlineData(42)] // a positive count is valid
|
||||
[InlineData(0)] // No pages read is still a valid count.
|
||||
[InlineData(42)] // A positive count is valid.
|
||||
public void Validate_WhenConsecutivePagesReadIsNotNegative_ShouldNotHaveValidationError(int consecutivePagesRead)
|
||||
{
|
||||
// Arrange
|
||||
|
||||
+22
-22
@@ -35,10 +35,10 @@ public class DeleteConsumptionItemHistoryCommandValidatorTests
|
||||
}
|
||||
|
||||
[Theory]
|
||||
[InlineData("")] // the target user Id is empty
|
||||
[InlineData(" ")] // the target user Id is whitespace only
|
||||
[InlineData("not-a-guid")] // the target user Id is not a Guid
|
||||
[InlineData("00000000-0000-0000-0000-000000000000")] // the target user Id is the empty Guid
|
||||
[InlineData("")] // The target user Id is empty.
|
||||
[InlineData(" ")] // The target user Id is whitespace only.
|
||||
[InlineData("not-a-guid")] // The target user Id is not a Guid.
|
||||
[InlineData("00000000-0000-0000-0000-000000000000")] // The target user Id is the empty Guid.
|
||||
public void Validate_WhenTargetUserIdIsEmptyOrInvalid_ShouldHaveValidationError(string targetUserId)
|
||||
{
|
||||
// Arrange
|
||||
@@ -78,11 +78,11 @@ public class DeleteConsumptionItemHistoryCommandValidatorTests
|
||||
}
|
||||
|
||||
[Theory]
|
||||
[InlineData("")] // the media kind is empty
|
||||
[InlineData(" ")] // the media kind is whitespace only
|
||||
[InlineData("not-a-media-kind")] // the media kind is not a member name
|
||||
[InlineData("999")] // the media kind is numeric, which must not be accepted as a member name
|
||||
[InlineData("None")] // None is not a valid media kind for a consumption record
|
||||
[InlineData("")] // The media kind is empty.
|
||||
[InlineData(" ")] // The media kind is whitespace only.
|
||||
[InlineData("not-a-media-kind")] // The media kind is not a member name.
|
||||
[InlineData("999")] // The media kind is numeric, which must not be accepted as a member name.
|
||||
[InlineData("None")] // None is not a valid media kind for a consumption record.
|
||||
public void Validate_WhenMediaKindIsInvalid_ShouldHaveValidationError(string mediaKind)
|
||||
{
|
||||
// Arrange
|
||||
@@ -96,11 +96,11 @@ public class DeleteConsumptionItemHistoryCommandValidatorTests
|
||||
}
|
||||
|
||||
[Theory]
|
||||
[InlineData(nameof(MediaKind.MusicTrack))] // a kind supported by the current catalogues
|
||||
[InlineData(nameof(MediaKind.Book))] // another kind supported by the current catalogues
|
||||
[InlineData(nameof(MediaKind.Movie))] // a kind without a catalogue, still a defined kind
|
||||
[InlineData(nameof(MediaKind.Photo))] // a kind that every session counts for, still a defined kind
|
||||
[InlineData("musicTrack")] // member names are matched case-insensitively
|
||||
[InlineData(nameof(MediaKind.MusicTrack))] // A kind supported by the current catalogues.
|
||||
[InlineData(nameof(MediaKind.Book))] // Another kind supported by the current catalogues.
|
||||
[InlineData(nameof(MediaKind.Movie))] // A kind without a catalogue, still a defined kind.
|
||||
[InlineData(nameof(MediaKind.Photo))] // A kind that every session counts for, still a defined kind.
|
||||
[InlineData("musicTrack")] // Member names are matched case-insensitively.
|
||||
public void Validate_WhenMediaKindIsDefined_ShouldNotHaveValidationError(string mediaKind)
|
||||
{
|
||||
// Arrange
|
||||
@@ -127,10 +127,10 @@ public class DeleteConsumptionItemHistoryCommandValidatorTests
|
||||
}
|
||||
|
||||
[Theory]
|
||||
[InlineData("")] // the media item Id is empty
|
||||
[InlineData(" ")] // the media item Id is whitespace only
|
||||
[InlineData("not-a-guid")] // the media item Id is not a Guid
|
||||
[InlineData("00000000-0000-0000-0000-000000000000")] // the media item Id is the empty Guid
|
||||
[InlineData("")] // The media item Id is empty.
|
||||
[InlineData(" ")] // The media item Id is whitespace only.
|
||||
[InlineData("not-a-guid")] // The media item Id is not a Guid.
|
||||
[InlineData("00000000-0000-0000-0000-000000000000")] // The media item Id is the empty Guid.
|
||||
public void Validate_WhenMediaItemIdIsEmptyOrInvalid_ShouldHaveValidationError(string mediaItemId)
|
||||
{
|
||||
// Arrange
|
||||
@@ -170,10 +170,10 @@ public class DeleteConsumptionItemHistoryCommandValidatorTests
|
||||
}
|
||||
|
||||
[Theory]
|
||||
[InlineData("")] // the library Id is empty
|
||||
[InlineData(" ")] // the library Id is whitespace only
|
||||
[InlineData("not-a-guid")] // the library Id is not a Guid
|
||||
[InlineData("00000000-0000-0000-0000-000000000000")] // the library Id is the empty Guid
|
||||
[InlineData("")] // The library Id is empty.
|
||||
[InlineData(" ")] // The library Id is whitespace only.
|
||||
[InlineData("not-a-guid")] // The library Id is not a Guid.
|
||||
[InlineData("00000000-0000-0000-0000-000000000000")] // The library Id is the empty Guid.
|
||||
public void Validate_WhenLibraryIdIsEmptyOrInvalid_ShouldHaveValidationError(string libraryId)
|
||||
{
|
||||
// Arrange
|
||||
|
||||
+8
-8
@@ -33,10 +33,10 @@ public class DeleteConsumptionRecordCommandValidatorTests
|
||||
}
|
||||
|
||||
[Theory]
|
||||
[InlineData("")] // the consumption record Id is empty
|
||||
[InlineData(" ")] // the consumption record Id is whitespace only
|
||||
[InlineData("not-a-guid")] // the consumption record Id is not a Guid
|
||||
[InlineData("00000000-0000-0000-0000-000000000000")] // the consumption record Id is the empty Guid
|
||||
[InlineData("")] // The consumption record Id is empty.
|
||||
[InlineData(" ")] // The consumption record Id is whitespace only.
|
||||
[InlineData("not-a-guid")] // The consumption record Id is not a Guid.
|
||||
[InlineData("00000000-0000-0000-0000-000000000000")] // The consumption record Id is the empty Guid.
|
||||
public void Validate_WhenConsumptionRecordIdIsEmptyOrInvalid_ShouldHaveValidationError(string consumptionRecordId)
|
||||
{
|
||||
// Arrange
|
||||
@@ -76,10 +76,10 @@ public class DeleteConsumptionRecordCommandValidatorTests
|
||||
}
|
||||
|
||||
[Theory]
|
||||
[InlineData("")] // the target user Id is empty
|
||||
[InlineData(" ")] // the target user Id is whitespace only
|
||||
[InlineData("not-a-guid")] // the target user Id is not a Guid
|
||||
[InlineData("00000000-0000-0000-0000-000000000000")] // the target user Id is the empty Guid
|
||||
[InlineData("")] // The target user Id is empty.
|
||||
[InlineData(" ")] // The target user Id is whitespace only.
|
||||
[InlineData("not-a-guid")] // The target user Id is not a Guid.
|
||||
[InlineData("00000000-0000-0000-0000-000000000000")] // The target user Id is the empty Guid.
|
||||
public void Validate_WhenTargetUserIdIsEmptyOrInvalid_ShouldHaveValidationError(string targetUserId)
|
||||
{
|
||||
// Arrange
|
||||
|
||||
+26
-26
@@ -34,10 +34,10 @@ public class ReportConsumptionProgressCommandValidatorTests
|
||||
}
|
||||
|
||||
[Theory]
|
||||
[InlineData("")] // the consumption record Id is empty
|
||||
[InlineData(" ")] // the consumption record Id is whitespace only
|
||||
[InlineData("not-a-guid")] // the consumption record Id is not a Guid
|
||||
[InlineData("00000000-0000-0000-0000-000000000000")] // the consumption record Id is the empty Guid
|
||||
[InlineData("")] // The consumption record Id is empty.
|
||||
[InlineData(" ")] // The consumption record Id is whitespace only.
|
||||
[InlineData("not-a-guid")] // The consumption record Id is not a Guid.
|
||||
[InlineData("00000000-0000-0000-0000-000000000000")] // The consumption record Id is the empty Guid.
|
||||
public void Validate_WhenConsumptionRecordIdIsEmptyOrInvalid_ShouldHaveValidationError(string consumptionRecordId)
|
||||
{
|
||||
// Arrange
|
||||
@@ -182,8 +182,8 @@ public class ReportConsumptionProgressCommandValidatorTests
|
||||
}
|
||||
|
||||
[Theory]
|
||||
[InlineData(-1)] // a negative offset cannot describe a position within a media item
|
||||
[InlineData(-0.5)] // a fractional negative offset is rejected the same way
|
||||
[InlineData(-1)] // A negative offset cannot describe a position within a media item.
|
||||
[InlineData(-0.5)] // A fractional negative offset is rejected the same way.
|
||||
public void Validate_WhenPositionKindIsTimeOffsetAndOffsetIsNegative_ShouldHaveValidationError(double timeOffsetInSeconds)
|
||||
{
|
||||
// Arrange
|
||||
@@ -199,9 +199,9 @@ public class ReportConsumptionProgressCommandValidatorTests
|
||||
}
|
||||
|
||||
[Theory]
|
||||
[InlineData(double.NaN)] // not a number is not a position
|
||||
[InlineData(double.PositiveInfinity)] // an infinite offset is not a position
|
||||
[InlineData(double.NegativeInfinity)] // a negative infinite offset is not a position either
|
||||
[InlineData(double.NaN)] // Not a number is not a position.
|
||||
[InlineData(double.PositiveInfinity)] // An infinite offset is not a position.
|
||||
[InlineData(double.NegativeInfinity)] // A negative infinite offset is not a position either.
|
||||
public void Validate_WhenPositionKindIsTimeOffsetAndOffsetIsNotFinite_ShouldHaveValidationError(double timeOffsetInSeconds)
|
||||
{
|
||||
// Arrange
|
||||
@@ -340,8 +340,8 @@ public class ReportConsumptionProgressCommandValidatorTests
|
||||
}
|
||||
|
||||
[Theory]
|
||||
[InlineData(-0.1)] // a fraction below zero is not a fraction of the media item
|
||||
[InlineData(1.1)] // a fraction above one is not a fraction of the media item
|
||||
[InlineData(-0.1)] // A fraction below zero is not a fraction of the media item.
|
||||
[InlineData(1.1)] // A fraction above one is not a fraction of the media item.
|
||||
public void Validate_WhenProgressFractionIsOutsideItsRange_ShouldHaveValidationError(double progressFraction)
|
||||
{
|
||||
// Arrange
|
||||
@@ -355,9 +355,9 @@ public class ReportConsumptionProgressCommandValidatorTests
|
||||
}
|
||||
|
||||
[Theory]
|
||||
[InlineData(double.NaN)] // not a number is not a fraction
|
||||
[InlineData(double.PositiveInfinity)] // an infinite fraction is not a fraction
|
||||
[InlineData(double.NegativeInfinity)] // a negative infinite fraction is not a fraction
|
||||
[InlineData(double.NaN)] // Not a number is not a fraction.
|
||||
[InlineData(double.PositiveInfinity)] // An infinite fraction is not a fraction.
|
||||
[InlineData(double.NegativeInfinity)] // A negative infinite fraction is not a fraction.
|
||||
public void Validate_WhenProgressFractionIsNotFinite_ShouldHaveValidationError(double progressFraction)
|
||||
{
|
||||
// Arrange
|
||||
@@ -371,9 +371,9 @@ public class ReportConsumptionProgressCommandValidatorTests
|
||||
}
|
||||
|
||||
[Theory]
|
||||
[InlineData(0)] // the start of the media item is a valid fraction
|
||||
[InlineData(0.5)] // a fraction in between the boundaries is valid
|
||||
[InlineData(1)] // the end of the media item is a valid fraction
|
||||
[InlineData(0)] // The start of the media item is a valid fraction.
|
||||
[InlineData(0.5)] // A fraction in between the boundaries is valid.
|
||||
[InlineData(1)] // The end of the media item is a valid fraction.
|
||||
public void Validate_WhenProgressFractionIsWithinItsRange_ShouldNotHaveValidationError(double progressFraction)
|
||||
{
|
||||
// Arrange
|
||||
@@ -400,8 +400,8 @@ public class ReportConsumptionProgressCommandValidatorTests
|
||||
}
|
||||
|
||||
[Theory]
|
||||
[InlineData(-1)] // a negative duration cannot describe consumed time
|
||||
[InlineData(-0.5)] // a fractional negative duration is rejected the same way
|
||||
[InlineData(-1)] // A negative duration cannot describe consumed time.
|
||||
[InlineData(-0.5)] // A fractional negative duration is rejected the same way.
|
||||
public void Validate_WhenConsumedDurationIsNegative_ShouldHaveValidationError(double consumedDurationInSeconds)
|
||||
{
|
||||
// Arrange
|
||||
@@ -415,9 +415,9 @@ public class ReportConsumptionProgressCommandValidatorTests
|
||||
}
|
||||
|
||||
[Theory]
|
||||
[InlineData(double.NaN)] // not a number is not a duration
|
||||
[InlineData(double.PositiveInfinity)] // an infinite duration is not a duration
|
||||
[InlineData(double.NegativeInfinity)] // a negative infinite duration is not a duration
|
||||
[InlineData(double.NaN)] // Not a number is not a duration.
|
||||
[InlineData(double.PositiveInfinity)] // An infinite duration is not a duration.
|
||||
[InlineData(double.NegativeInfinity)] // A negative infinite duration is not a duration.
|
||||
public void Validate_WhenConsumedDurationIsNotFinite_ShouldHaveValidationError(double consumedDurationInSeconds)
|
||||
{
|
||||
// Arrange
|
||||
@@ -444,8 +444,8 @@ public class ReportConsumptionProgressCommandValidatorTests
|
||||
}
|
||||
|
||||
[Theory]
|
||||
[InlineData(0)] // a session that consumed no time is valid
|
||||
[InlineData(2_678_400)] // exactly the maximum accepted duration is valid
|
||||
[InlineData(0)] // A session that consumed no time is valid.
|
||||
[InlineData(2_678_400)] // Exactly the maximum accepted duration is valid.
|
||||
public void Validate_WhenConsumedDurationIsWithinItsRange_ShouldNotHaveValidationError(double consumedDurationInSeconds)
|
||||
{
|
||||
// Arrange
|
||||
@@ -473,8 +473,8 @@ public class ReportConsumptionProgressCommandValidatorTests
|
||||
}
|
||||
|
||||
[Theory]
|
||||
[InlineData(0)] // no pages read is still a valid count
|
||||
[InlineData(42)] // a positive count is valid
|
||||
[InlineData(0)] // No pages read is still a valid count.
|
||||
[InlineData(42)] // A positive count is valid.
|
||||
public void Validate_WhenConsecutivePagesReadIsNotNegative_ShouldNotHaveValidationError(int consecutivePagesRead)
|
||||
{
|
||||
// Arrange
|
||||
|
||||
+16
-16
@@ -33,10 +33,10 @@ public class StartConsumptionCommandValidatorTests
|
||||
}
|
||||
|
||||
[Theory]
|
||||
[InlineData("")] // the library Id is empty
|
||||
[InlineData(" ")] // the library Id is whitespace only
|
||||
[InlineData("not-a-guid")] // the library Id is not a Guid
|
||||
[InlineData("00000000-0000-0000-0000-000000000000")] // the library Id is the empty Guid
|
||||
[InlineData("")] // The library Id is empty.
|
||||
[InlineData(" ")] // The library Id is whitespace only.
|
||||
[InlineData("not-a-guid")] // The library Id is not a Guid.
|
||||
[InlineData("00000000-0000-0000-0000-000000000000")] // The library Id is the empty Guid.
|
||||
public void Validate_WhenLibraryIdIsEmptyOrInvalid_ShouldHaveValidationError(string libraryId)
|
||||
{
|
||||
// Arrange
|
||||
@@ -76,11 +76,11 @@ public class StartConsumptionCommandValidatorTests
|
||||
}
|
||||
|
||||
[Theory]
|
||||
[InlineData("")] // the media kind is empty
|
||||
[InlineData(" ")] // the media kind is whitespace only
|
||||
[InlineData("Hologram")] // the media kind is not a member of the enumeration
|
||||
[InlineData("0")] // the media kind is a numeric route value, which the validator rejects by name
|
||||
[InlineData("1")] // a numeric route value that parses to the defined MusicTrack member, which the old Enum.TryParse and Enum.IsDefined logic accepted
|
||||
[InlineData("")] // The media kind is empty.
|
||||
[InlineData(" ")] // The media kind is whitespace only.
|
||||
[InlineData("Hologram")] // The media kind is not a member of the enumeration.
|
||||
[InlineData("0")] // The media kind is a numeric route value, which the validator rejects by name.
|
||||
[InlineData("1")] // A numeric route value that parses to the defined MusicTrack member, which the old Enum.TryParse and Enum.IsDefined logic accepted.
|
||||
public void Validate_WhenMediaKindIsEmptyOrUnsupported_ShouldHaveValidationError(string mediaKind)
|
||||
{
|
||||
// Arrange
|
||||
@@ -94,7 +94,7 @@ public class StartConsumptionCommandValidatorTests
|
||||
}
|
||||
|
||||
[Theory]
|
||||
[InlineData("None")] // the default enumeration member is still a member name
|
||||
[InlineData("None")] // The default enumeration member is still a member name.
|
||||
[InlineData("MusicTrack")]
|
||||
[InlineData("PodcastEpisode")]
|
||||
[InlineData("Audiobook")]
|
||||
@@ -116,8 +116,8 @@ public class StartConsumptionCommandValidatorTests
|
||||
}
|
||||
|
||||
[Theory]
|
||||
[InlineData("musictrack")] // the member name is lower case
|
||||
[InlineData("BoOk")] // the member name is mixed case
|
||||
[InlineData("musictrack")] // The member name is lower case.
|
||||
[InlineData("BoOk")] // The member name is mixed case.
|
||||
public void Validate_WhenMediaKindUsesDifferentCasing_ShouldNotHaveValidationError(string mediaKind)
|
||||
{
|
||||
// Arrange
|
||||
@@ -144,10 +144,10 @@ public class StartConsumptionCommandValidatorTests
|
||||
}
|
||||
|
||||
[Theory]
|
||||
[InlineData("")] // the media item Id is empty
|
||||
[InlineData(" ")] // the media item Id is whitespace only
|
||||
[InlineData("not-a-guid")] // the media item Id is not a Guid
|
||||
[InlineData("00000000-0000-0000-0000-000000000000")] // the media item Id is the empty Guid
|
||||
[InlineData("")] // The media item Id is empty.
|
||||
[InlineData(" ")] // The media item Id is whitespace only.
|
||||
[InlineData("not-a-guid")] // The media item Id is not a Guid.
|
||||
[InlineData("00000000-0000-0000-0000-000000000000")] // The media item Id is the empty Guid.
|
||||
public void Validate_WhenMediaItemIdIsEmptyOrInvalid_ShouldHaveValidationError(string mediaItemId)
|
||||
{
|
||||
// Arrange
|
||||
|
||||
+26
-26
@@ -34,10 +34,10 @@ public class StopConsumptionCommandValidatorTests
|
||||
}
|
||||
|
||||
[Theory]
|
||||
[InlineData("")] // the consumption record Id is empty
|
||||
[InlineData(" ")] // the consumption record Id is whitespace only
|
||||
[InlineData("not-a-guid")] // the consumption record Id is not a Guid
|
||||
[InlineData("00000000-0000-0000-0000-000000000000")] // the consumption record Id is the empty Guid
|
||||
[InlineData("")] // The consumption record Id is empty.
|
||||
[InlineData(" ")] // The consumption record Id is whitespace only.
|
||||
[InlineData("not-a-guid")] // The consumption record Id is not a Guid.
|
||||
[InlineData("00000000-0000-0000-0000-000000000000")] // The consumption record Id is the empty Guid.
|
||||
public void Validate_WhenConsumptionRecordIdIsEmptyOrInvalid_ShouldHaveValidationError(string consumptionRecordId)
|
||||
{
|
||||
// Arrange
|
||||
@@ -182,8 +182,8 @@ public class StopConsumptionCommandValidatorTests
|
||||
}
|
||||
|
||||
[Theory]
|
||||
[InlineData(-1)] // a negative offset cannot describe a position within a media item
|
||||
[InlineData(-0.5)] // a fractional negative offset is rejected the same way
|
||||
[InlineData(-1)] // A negative offset cannot describe a position within a media item.
|
||||
[InlineData(-0.5)] // A fractional negative offset is rejected the same way.
|
||||
public void Validate_WhenPositionKindIsTimeOffsetAndOffsetIsNegative_ShouldHaveValidationError(double timeOffsetInSeconds)
|
||||
{
|
||||
// Arrange
|
||||
@@ -199,9 +199,9 @@ public class StopConsumptionCommandValidatorTests
|
||||
}
|
||||
|
||||
[Theory]
|
||||
[InlineData(double.NaN)] // not a number is not a position
|
||||
[InlineData(double.PositiveInfinity)] // an infinite offset is not a position
|
||||
[InlineData(double.NegativeInfinity)] // a negative infinite offset is not a position either
|
||||
[InlineData(double.NaN)] // Not a number is not a position.
|
||||
[InlineData(double.PositiveInfinity)] // An infinite offset is not a position.
|
||||
[InlineData(double.NegativeInfinity)] // A negative infinite offset is not a position either.
|
||||
public void Validate_WhenPositionKindIsTimeOffsetAndOffsetIsNotFinite_ShouldHaveValidationError(double timeOffsetInSeconds)
|
||||
{
|
||||
// Arrange
|
||||
@@ -340,8 +340,8 @@ public class StopConsumptionCommandValidatorTests
|
||||
}
|
||||
|
||||
[Theory]
|
||||
[InlineData(-0.1)] // a fraction below zero is not a fraction of the media item
|
||||
[InlineData(1.1)] // a fraction above one is not a fraction of the media item
|
||||
[InlineData(-0.1)] // A fraction below zero is not a fraction of the media item.
|
||||
[InlineData(1.1)] // A fraction above one is not a fraction of the media item.
|
||||
public void Validate_WhenProgressFractionIsOutsideItsRange_ShouldHaveValidationError(double progressFraction)
|
||||
{
|
||||
// Arrange
|
||||
@@ -355,9 +355,9 @@ public class StopConsumptionCommandValidatorTests
|
||||
}
|
||||
|
||||
[Theory]
|
||||
[InlineData(double.NaN)] // not a number is not a fraction
|
||||
[InlineData(double.PositiveInfinity)] // an infinite fraction is not a fraction
|
||||
[InlineData(double.NegativeInfinity)] // a negative infinite fraction is not a fraction
|
||||
[InlineData(double.NaN)] // Not a number is not a fraction.
|
||||
[InlineData(double.PositiveInfinity)] // An infinite fraction is not a fraction.
|
||||
[InlineData(double.NegativeInfinity)] // A negative infinite fraction is not a fraction.
|
||||
public void Validate_WhenProgressFractionIsNotFinite_ShouldHaveValidationError(double progressFraction)
|
||||
{
|
||||
// Arrange
|
||||
@@ -371,9 +371,9 @@ public class StopConsumptionCommandValidatorTests
|
||||
}
|
||||
|
||||
[Theory]
|
||||
[InlineData(0)] // the start of the media item is a valid fraction
|
||||
[InlineData(0.5)] // a fraction in between the boundaries is valid
|
||||
[InlineData(1)] // the end of the media item is a valid fraction
|
||||
[InlineData(0)] // The start of the media item is a valid fraction.
|
||||
[InlineData(0.5)] // A fraction in between the boundaries is valid.
|
||||
[InlineData(1)] // The end of the media item is a valid fraction.
|
||||
public void Validate_WhenProgressFractionIsWithinItsRange_ShouldNotHaveValidationError(double progressFraction)
|
||||
{
|
||||
// Arrange
|
||||
@@ -400,8 +400,8 @@ public class StopConsumptionCommandValidatorTests
|
||||
}
|
||||
|
||||
[Theory]
|
||||
[InlineData(-1)] // a negative duration cannot describe consumed time
|
||||
[InlineData(-0.5)] // a fractional negative duration is rejected the same way
|
||||
[InlineData(-1)] // A negative duration cannot describe consumed time.
|
||||
[InlineData(-0.5)] // A fractional negative duration is rejected the same way.
|
||||
public void Validate_WhenConsumedDurationIsNegative_ShouldHaveValidationError(double consumedDurationInSeconds)
|
||||
{
|
||||
// Arrange
|
||||
@@ -415,9 +415,9 @@ public class StopConsumptionCommandValidatorTests
|
||||
}
|
||||
|
||||
[Theory]
|
||||
[InlineData(double.NaN)] // not a number is not a duration
|
||||
[InlineData(double.PositiveInfinity)] // an infinite duration is not a duration
|
||||
[InlineData(double.NegativeInfinity)] // a negative infinite duration is not a duration
|
||||
[InlineData(double.NaN)] // Not a number is not a duration.
|
||||
[InlineData(double.PositiveInfinity)] // An infinite duration is not a duration.
|
||||
[InlineData(double.NegativeInfinity)] // A negative infinite duration is not a duration.
|
||||
public void Validate_WhenConsumedDurationIsNotFinite_ShouldHaveValidationError(double consumedDurationInSeconds)
|
||||
{
|
||||
// Arrange
|
||||
@@ -444,8 +444,8 @@ public class StopConsumptionCommandValidatorTests
|
||||
}
|
||||
|
||||
[Theory]
|
||||
[InlineData(0)] // a session that consumed no time is valid
|
||||
[InlineData(2_678_400)] // exactly the maximum accepted duration is valid
|
||||
[InlineData(0)] // A session that consumed no time is valid.
|
||||
[InlineData(2_678_400)] // Exactly the maximum accepted duration is valid.
|
||||
public void Validate_WhenConsumedDurationIsWithinItsRange_ShouldNotHaveValidationError(double consumedDurationInSeconds)
|
||||
{
|
||||
// Arrange
|
||||
@@ -486,8 +486,8 @@ public class StopConsumptionCommandValidatorTests
|
||||
}
|
||||
|
||||
[Theory]
|
||||
[InlineData(0)] // no pages read is still a valid count
|
||||
[InlineData(42)] // a positive count is valid
|
||||
[InlineData(0)] // No pages read is still a valid count.
|
||||
[InlineData(42)] // A positive count is valid.
|
||||
public void Validate_WhenConsecutivePagesReadIsNotNegative_ShouldNotHaveValidationError(int consecutivePagesRead)
|
||||
{
|
||||
// Arrange
|
||||
|
||||
+11
-11
@@ -35,10 +35,10 @@ public class GetAllUsersConsumptionStatisticsQueryValidatorTests
|
||||
}
|
||||
|
||||
[Theory]
|
||||
[InlineData("")] // the library Id is empty
|
||||
[InlineData(" ")] // the library Id is whitespace only
|
||||
[InlineData("not-a-guid")] // the library Id is not a Guid
|
||||
[InlineData("00000000-0000-0000-0000-000000000000")] // the library Id is the empty Guid
|
||||
[InlineData("")] // The library Id is empty.
|
||||
[InlineData(" ")] // The library Id is whitespace only.
|
||||
[InlineData("not-a-guid")] // The library Id is not a Guid.
|
||||
[InlineData("00000000-0000-0000-0000-000000000000")] // The library Id is the empty Guid.
|
||||
public void Validate_WhenLibraryIdIsEmptyOrInvalid_ShouldHaveValidationError(string libraryId)
|
||||
{
|
||||
// Arrange
|
||||
@@ -104,10 +104,10 @@ public class GetAllUsersConsumptionStatisticsQueryValidatorTests
|
||||
}
|
||||
|
||||
[Theory]
|
||||
[InlineData(nameof(MediaKind.MusicTrack))] // a kind supported by the current catalogues
|
||||
[InlineData(nameof(MediaKind.Book))] // another kind supported by the current catalogues
|
||||
[InlineData(nameof(MediaKind.Movie))] // a kind without a catalogue, still a defined kind
|
||||
[InlineData(nameof(MediaKind.Photo))] // a kind that every session counts for, still a defined kind
|
||||
[InlineData(nameof(MediaKind.MusicTrack))] // A kind supported by the current catalogues.
|
||||
[InlineData(nameof(MediaKind.Book))] // Another kind supported by the current catalogues.
|
||||
[InlineData(nameof(MediaKind.Movie))] // A kind without a catalogue, still a defined kind.
|
||||
[InlineData(nameof(MediaKind.Photo))] // A kind that every session counts for, still a defined kind.
|
||||
public void Validate_WhenMediaKindIsDefined_ShouldNotHaveValidationError(string mediaKind)
|
||||
{
|
||||
// Arrange
|
||||
@@ -180,9 +180,9 @@ public class GetAllUsersConsumptionStatisticsQueryValidatorTests
|
||||
}
|
||||
|
||||
[Theory]
|
||||
[InlineData("")] // an empty bound
|
||||
[InlineData("not-a-date")] // a textual value that is not a date
|
||||
[InlineData("2026-13-45T99:99:99")] // a value with out of range components
|
||||
[InlineData("")] // An empty bound.
|
||||
[InlineData("not-a-date")] // A textual value that is not a date.
|
||||
[InlineData("2026-13-45T99:99:99")] // A value with out of range components.
|
||||
public void Validate_WhenADateRangeBoundIsNotAValidDate_ShouldHaveValidationError(string invalidBound)
|
||||
{
|
||||
// Arrange
|
||||
|
||||
+4
-4
@@ -33,10 +33,10 @@ public class GetConsumptionRecordQueryValidatorTests
|
||||
}
|
||||
|
||||
[Theory]
|
||||
[InlineData("")] // the consumption record Id is empty
|
||||
[InlineData(" ")] // the consumption record Id is whitespace only
|
||||
[InlineData("not-a-guid")] // the consumption record Id is not a Guid
|
||||
[InlineData("00000000-0000-0000-0000-000000000000")] // the consumption record Id is the empty Guid
|
||||
[InlineData("")] // The consumption record Id is empty.
|
||||
[InlineData(" ")] // The consumption record Id is whitespace only.
|
||||
[InlineData("not-a-guid")] // The consumption record Id is not a Guid.
|
||||
[InlineData("00000000-0000-0000-0000-000000000000")] // The consumption record Id is the empty Guid.
|
||||
public void Validate_WhenConsumptionRecordIdIsEmptyOrInvalid_ShouldHaveValidationError(string consumptionRecordId)
|
||||
{
|
||||
// Arrange
|
||||
|
||||
+15
-15
@@ -35,10 +35,10 @@ public class GetConsumptionStatisticsQueryValidatorTests
|
||||
}
|
||||
|
||||
[Theory]
|
||||
[InlineData("")] // the target user Id is empty
|
||||
[InlineData(" ")] // the target user Id is whitespace only
|
||||
[InlineData("not-a-guid")] // the target user Id is not a Guid
|
||||
[InlineData("00000000-0000-0000-0000-000000000000")] // the target user Id is the empty Guid
|
||||
[InlineData("")] // The target user Id is empty.
|
||||
[InlineData(" ")] // The target user Id is whitespace only.
|
||||
[InlineData("not-a-guid")] // The target user Id is not a Guid.
|
||||
[InlineData("00000000-0000-0000-0000-000000000000")] // The target user Id is the empty Guid.
|
||||
public void Validate_WhenTargetUserIdIsEmptyOrInvalid_ShouldHaveValidationError(string targetUserId)
|
||||
{
|
||||
// Arrange
|
||||
@@ -78,10 +78,10 @@ public class GetConsumptionStatisticsQueryValidatorTests
|
||||
}
|
||||
|
||||
[Theory]
|
||||
[InlineData("")] // the library Id is empty
|
||||
[InlineData(" ")] // the library Id is whitespace only
|
||||
[InlineData("not-a-guid")] // the library Id is not a Guid
|
||||
[InlineData("00000000-0000-0000-0000-000000000000")] // the library Id is the empty Guid
|
||||
[InlineData("")] // The library Id is empty.
|
||||
[InlineData(" ")] // The library Id is whitespace only.
|
||||
[InlineData("not-a-guid")] // The library Id is not a Guid.
|
||||
[InlineData("00000000-0000-0000-0000-000000000000")] // The library Id is the empty Guid.
|
||||
public void Validate_WhenLibraryIdIsEmptyOrInvalid_ShouldHaveValidationError(string libraryId)
|
||||
{
|
||||
// Arrange
|
||||
@@ -147,10 +147,10 @@ public class GetConsumptionStatisticsQueryValidatorTests
|
||||
}
|
||||
|
||||
[Theory]
|
||||
[InlineData(nameof(MediaKind.MusicTrack))] // a kind supported by the current catalogues
|
||||
[InlineData(nameof(MediaKind.Book))] // another kind supported by the current catalogues
|
||||
[InlineData(nameof(MediaKind.Movie))] // a kind without a catalogue, still a defined kind
|
||||
[InlineData(nameof(MediaKind.Photo))] // a kind that every session counts for, still a defined kind
|
||||
[InlineData(nameof(MediaKind.MusicTrack))] // A kind supported by the current catalogues.
|
||||
[InlineData(nameof(MediaKind.Book))] // Another kind supported by the current catalogues.
|
||||
[InlineData(nameof(MediaKind.Movie))] // A kind without a catalogue, still a defined kind.
|
||||
[InlineData(nameof(MediaKind.Photo))] // A kind that every session counts for, still a defined kind.
|
||||
public void Validate_WhenMediaKindIsDefined_ShouldNotHaveValidationError(string mediaKind)
|
||||
{
|
||||
// Arrange
|
||||
@@ -223,9 +223,9 @@ public class GetConsumptionStatisticsQueryValidatorTests
|
||||
}
|
||||
|
||||
[Theory]
|
||||
[InlineData("")] // an empty bound
|
||||
[InlineData("not-a-date")] // a textual value that is not a date
|
||||
[InlineData("2026-13-45T99:99:99")] // a value with out of range components
|
||||
[InlineData("")] // An empty bound.
|
||||
[InlineData("not-a-date")] // A textual value that is not a date.
|
||||
[InlineData("2026-13-45T99:99:99")] // A value with out of range components.
|
||||
public void Validate_WhenADateRangeBoundIsNotAValidDate_ShouldHaveValidationError(string invalidBound)
|
||||
{
|
||||
// Arrange
|
||||
|
||||
+22
-22
@@ -36,10 +36,10 @@ public class GetGenreConsumptionQueryValidatorTests
|
||||
}
|
||||
|
||||
[Theory]
|
||||
[InlineData("")] // the target user Id is empty
|
||||
[InlineData(" ")] // the target user Id is whitespace only
|
||||
[InlineData("not-a-guid")] // the target user Id is not a Guid
|
||||
[InlineData("00000000-0000-0000-0000-000000000000")] // the target user Id is the empty Guid
|
||||
[InlineData("")] // The target user Id is empty.
|
||||
[InlineData(" ")] // The target user Id is whitespace only.
|
||||
[InlineData("not-a-guid")] // The target user Id is not a Guid.
|
||||
[InlineData("00000000-0000-0000-0000-000000000000")] // The target user Id is the empty Guid.
|
||||
public void Validate_WhenTargetUserIdIsEmptyOrInvalid_ShouldHaveValidationError(string targetUserId)
|
||||
{
|
||||
// Arrange
|
||||
@@ -79,10 +79,10 @@ public class GetGenreConsumptionQueryValidatorTests
|
||||
}
|
||||
|
||||
[Theory]
|
||||
[InlineData("")] // the library Id is empty
|
||||
[InlineData(" ")] // the library Id is whitespace only
|
||||
[InlineData("not-a-guid")] // the library Id is not a Guid
|
||||
[InlineData("00000000-0000-0000-0000-000000000000")] // the library Id is the empty Guid
|
||||
[InlineData("")] // The library Id is empty.
|
||||
[InlineData(" ")] // The library Id is whitespace only.
|
||||
[InlineData("not-a-guid")] // The library Id is not a Guid.
|
||||
[InlineData("00000000-0000-0000-0000-000000000000")] // The library Id is the empty Guid.
|
||||
public void Validate_WhenLibraryIdIsEmptyOrInvalid_ShouldHaveValidationError(string libraryId)
|
||||
{
|
||||
// Arrange
|
||||
@@ -122,11 +122,11 @@ public class GetGenreConsumptionQueryValidatorTests
|
||||
}
|
||||
|
||||
[Theory]
|
||||
[InlineData("")] // the media kind is empty
|
||||
[InlineData(" ")] // the media kind is whitespace only
|
||||
[InlineData("not-a-media-kind")] // the media kind is not a member name
|
||||
[InlineData("999")] // the media kind is numeric, which must not be accepted as a member name
|
||||
[InlineData("None")] // None is not a valid media kind for a consumption record
|
||||
[InlineData("")] // The media kind is empty.
|
||||
[InlineData(" ")] // The media kind is whitespace only.
|
||||
[InlineData("not-a-media-kind")] // The media kind is not a member name.
|
||||
[InlineData("999")] // The media kind is numeric, which must not be accepted as a member name.
|
||||
[InlineData("None")] // None is not a valid media kind for a consumption record.
|
||||
public void Validate_WhenMediaKindIsInvalid_ShouldHaveValidationError(string mediaKind)
|
||||
{
|
||||
// Arrange
|
||||
@@ -140,11 +140,11 @@ public class GetGenreConsumptionQueryValidatorTests
|
||||
}
|
||||
|
||||
[Theory]
|
||||
[InlineData(nameof(MediaKind.MusicTrack))] // a kind supported by the current catalogues
|
||||
[InlineData(nameof(MediaKind.Book))] // another kind supported by the current catalogues
|
||||
[InlineData(nameof(MediaKind.Movie))] // a kind without a catalogue, still a defined kind
|
||||
[InlineData(nameof(MediaKind.Photo))] // a kind that every session counts for, still a defined kind
|
||||
[InlineData("musicTrack")] // member names are matched case-insensitively
|
||||
[InlineData(nameof(MediaKind.MusicTrack))] // A kind supported by the current catalogues.
|
||||
[InlineData(nameof(MediaKind.Book))] // Another kind supported by the current catalogues.
|
||||
[InlineData(nameof(MediaKind.Movie))] // A kind without a catalogue, still a defined kind.
|
||||
[InlineData(nameof(MediaKind.Photo))] // A kind that every session counts for, still a defined kind.
|
||||
[InlineData("musicTrack")] // Member names are matched case-insensitively.
|
||||
public void Validate_WhenMediaKindIsDefined_ShouldNotHaveValidationError(string mediaKind)
|
||||
{
|
||||
// Arrange
|
||||
@@ -158,8 +158,8 @@ public class GetGenreConsumptionQueryValidatorTests
|
||||
}
|
||||
|
||||
[Theory]
|
||||
[InlineData("not-a-date")] // the start is not a date
|
||||
[InlineData("2026-13-01T00:00:00Z")] // the start is a date with an out of range month
|
||||
[InlineData("not-a-date")] // The start is not a date.
|
||||
[InlineData("2026-13-01T00:00:00Z")] // The start is a date with an out of range month.
|
||||
public void Validate_WhenFromUtcIsMalformed_ShouldHaveValidationError(string fromUtc)
|
||||
{
|
||||
// Arrange
|
||||
@@ -175,8 +175,8 @@ public class GetGenreConsumptionQueryValidatorTests
|
||||
}
|
||||
|
||||
[Theory]
|
||||
[InlineData("not-a-date")] // the end is not a date
|
||||
[InlineData("2026-13-01T00:00:00Z")] // the end is a date with an out of range month
|
||||
[InlineData("not-a-date")] // The end is not a date.
|
||||
[InlineData("2026-13-01T00:00:00Z")] // The end is a date with an out of range month.
|
||||
public void Validate_WhenToUtcIsMalformed_ShouldHaveValidationError(string toUtc)
|
||||
{
|
||||
// Arrange
|
||||
|
||||
+15
-15
@@ -35,10 +35,10 @@ public class GetMostConsumedQueryValidatorTests
|
||||
}
|
||||
|
||||
[Theory]
|
||||
[InlineData("")] // the target user Id is empty
|
||||
[InlineData(" ")] // the target user Id is whitespace only
|
||||
[InlineData("not-a-guid")] // the target user Id is not a Guid
|
||||
[InlineData("00000000-0000-0000-0000-000000000000")] // the target user Id is the empty Guid
|
||||
[InlineData("")] // The target user Id is empty.
|
||||
[InlineData(" ")] // The target user Id is whitespace only.
|
||||
[InlineData("not-a-guid")] // The target user Id is not a Guid.
|
||||
[InlineData("00000000-0000-0000-0000-000000000000")] // The target user Id is the empty Guid.
|
||||
public void Validate_WhenTargetUserIdIsEmptyOrInvalid_ShouldHaveValidationError(string targetUserId)
|
||||
{
|
||||
// Arrange
|
||||
@@ -78,10 +78,10 @@ public class GetMostConsumedQueryValidatorTests
|
||||
}
|
||||
|
||||
[Theory]
|
||||
[InlineData("")] // the library Id is empty
|
||||
[InlineData(" ")] // the library Id is whitespace only
|
||||
[InlineData("not-a-guid")] // the library Id is not a Guid
|
||||
[InlineData("00000000-0000-0000-0000-000000000000")] // the library Id is the empty Guid
|
||||
[InlineData("")] // The library Id is empty.
|
||||
[InlineData(" ")] // The library Id is whitespace only.
|
||||
[InlineData("not-a-guid")] // The library Id is not a Guid.
|
||||
[InlineData("00000000-0000-0000-0000-000000000000")] // The library Id is the empty Guid.
|
||||
public void Validate_WhenLibraryIdIsEmptyOrInvalid_ShouldHaveValidationError(string libraryId)
|
||||
{
|
||||
// Arrange
|
||||
@@ -147,10 +147,10 @@ public class GetMostConsumedQueryValidatorTests
|
||||
}
|
||||
|
||||
[Theory]
|
||||
[InlineData(nameof(MediaKind.MusicTrack))] // a kind supported by the current catalogues
|
||||
[InlineData(nameof(MediaKind.Book))] // another kind supported by the current catalogues
|
||||
[InlineData(nameof(MediaKind.Movie))] // a kind without a catalogue, still a defined kind
|
||||
[InlineData(nameof(MediaKind.Photo))] // a kind that every session counts for, still a defined kind
|
||||
[InlineData(nameof(MediaKind.MusicTrack))] // A kind supported by the current catalogues.
|
||||
[InlineData(nameof(MediaKind.Book))] // Another kind supported by the current catalogues.
|
||||
[InlineData(nameof(MediaKind.Movie))] // A kind without a catalogue, still a defined kind.
|
||||
[InlineData(nameof(MediaKind.Photo))] // A kind that every session counts for, still a defined kind.
|
||||
public void Validate_WhenMediaKindIsDefined_ShouldNotHaveValidationError(string mediaKind)
|
||||
{
|
||||
// Arrange
|
||||
@@ -223,9 +223,9 @@ public class GetMostConsumedQueryValidatorTests
|
||||
}
|
||||
|
||||
[Theory]
|
||||
[InlineData("")] // an empty bound
|
||||
[InlineData("not-a-date")] // a textual value that is not a date
|
||||
[InlineData("2026-13-45T99:99:99")] // a value with out of range components
|
||||
[InlineData("")] // An empty bound.
|
||||
[InlineData("not-a-date")] // A textual value that is not a date.
|
||||
[InlineData("2026-13-45T99:99:99")] // A value with out of range components.
|
||||
public void Validate_WhenADateRangeBoundIsNotAValidDate_ShouldHaveValidationError(string invalidBound)
|
||||
{
|
||||
// Arrange
|
||||
|
||||
+15
-15
@@ -35,10 +35,10 @@ public class GetRecentlyConsumedQueryValidatorTests
|
||||
}
|
||||
|
||||
[Theory]
|
||||
[InlineData("")] // the target user Id is empty
|
||||
[InlineData(" ")] // the target user Id is whitespace only
|
||||
[InlineData("not-a-guid")] // the target user Id is not a Guid
|
||||
[InlineData("00000000-0000-0000-0000-000000000000")] // the target user Id is the empty Guid
|
||||
[InlineData("")] // The target user Id is empty.
|
||||
[InlineData(" ")] // The target user Id is whitespace only.
|
||||
[InlineData("not-a-guid")] // The target user Id is not a Guid.
|
||||
[InlineData("00000000-0000-0000-0000-000000000000")] // The target user Id is the empty Guid.
|
||||
public void Validate_WhenTargetUserIdIsEmptyOrInvalid_ShouldHaveValidationError(string targetUserId)
|
||||
{
|
||||
// Arrange
|
||||
@@ -78,10 +78,10 @@ public class GetRecentlyConsumedQueryValidatorTests
|
||||
}
|
||||
|
||||
[Theory]
|
||||
[InlineData("")] // the library Id is empty
|
||||
[InlineData(" ")] // the library Id is whitespace only
|
||||
[InlineData("not-a-guid")] // the library Id is not a Guid
|
||||
[InlineData("00000000-0000-0000-0000-000000000000")] // the library Id is the empty Guid
|
||||
[InlineData("")] // The library Id is empty.
|
||||
[InlineData(" ")] // The library Id is whitespace only.
|
||||
[InlineData("not-a-guid")] // The library Id is not a Guid.
|
||||
[InlineData("00000000-0000-0000-0000-000000000000")] // The library Id is the empty Guid.
|
||||
public void Validate_WhenLibraryIdIsEmptyOrInvalid_ShouldHaveValidationError(string libraryId)
|
||||
{
|
||||
// Arrange
|
||||
@@ -147,10 +147,10 @@ public class GetRecentlyConsumedQueryValidatorTests
|
||||
}
|
||||
|
||||
[Theory]
|
||||
[InlineData(nameof(MediaKind.MusicTrack))] // a kind supported by the current catalogues
|
||||
[InlineData(nameof(MediaKind.Book))] // another kind supported by the current catalogues
|
||||
[InlineData(nameof(MediaKind.Movie))] // a kind without a catalogue, still a defined kind
|
||||
[InlineData(nameof(MediaKind.Photo))] // a kind that every session counts for, still a defined kind
|
||||
[InlineData(nameof(MediaKind.MusicTrack))] // A kind supported by the current catalogues.
|
||||
[InlineData(nameof(MediaKind.Book))] // Another kind supported by the current catalogues.
|
||||
[InlineData(nameof(MediaKind.Movie))] // A kind without a catalogue, still a defined kind.
|
||||
[InlineData(nameof(MediaKind.Photo))] // A kind that every session counts for, still a defined kind.
|
||||
public void Validate_WhenMediaKindIsDefined_ShouldNotHaveValidationError(string mediaKind)
|
||||
{
|
||||
// Arrange
|
||||
@@ -223,9 +223,9 @@ public class GetRecentlyConsumedQueryValidatorTests
|
||||
}
|
||||
|
||||
[Theory]
|
||||
[InlineData("")] // an empty bound
|
||||
[InlineData("not-a-date")] // a textual value that is not a date
|
||||
[InlineData("2026-13-45T99:99:99")] // a value with out of range components
|
||||
[InlineData("")] // An empty bound.
|
||||
[InlineData("not-a-date")] // A textual value that is not a date.
|
||||
[InlineData("2026-13-45T99:99:99")] // A value with out of range components.
|
||||
public void Validate_WhenADateRangeBoundIsNotAValidDate_ShouldHaveValidationError(string invalidBound)
|
||||
{
|
||||
// Arrange
|
||||
|
||||
+16
-16
@@ -34,11 +34,11 @@ public class GetResumePointQueryValidatorTests
|
||||
}
|
||||
|
||||
[Theory]
|
||||
[InlineData("")] // the media kind is empty
|
||||
[InlineData(" ")] // the media kind is whitespace only
|
||||
[InlineData("not-a-media-kind")] // the media kind is not the name of a defined kind
|
||||
[InlineData("99999")] // a numeric value that is not the name of a defined kind
|
||||
[InlineData("1")] // a numeric value that parses to the defined MusicTrack member, which the old Enum.TryParse and Enum.IsDefined logic accepted
|
||||
[InlineData("")] // The media kind is empty.
|
||||
[InlineData(" ")] // The media kind is whitespace only.
|
||||
[InlineData("not-a-media-kind")] // The media kind is not the name of a defined kind.
|
||||
[InlineData("99999")] // A numeric value that is not the name of a defined kind.
|
||||
[InlineData("1")] // A numeric value that parses to the defined MusicTrack member, which the old Enum.TryParse and Enum.IsDefined logic accepted.
|
||||
public void Validate_WhenMediaKindIsNotTheNameOfADefinedKind_ShouldHaveValidationError(string mediaKind)
|
||||
{
|
||||
// Arrange
|
||||
@@ -52,10 +52,10 @@ public class GetResumePointQueryValidatorTests
|
||||
}
|
||||
|
||||
[Theory]
|
||||
[InlineData(nameof(MediaKind.MusicTrack))] // a kind supported by the current catalogues
|
||||
[InlineData(nameof(MediaKind.Book))] // another kind supported by the current catalogues
|
||||
[InlineData(nameof(MediaKind.Movie))] // a kind without a catalogue, still a defined kind
|
||||
[InlineData(nameof(MediaKind.Photo))] // a kind that cannot be resumed, still a defined kind
|
||||
[InlineData(nameof(MediaKind.MusicTrack))] // A kind supported by the current catalogues.
|
||||
[InlineData(nameof(MediaKind.Book))] // Another kind supported by the current catalogues.
|
||||
[InlineData(nameof(MediaKind.Movie))] // A kind without a catalogue, still a defined kind.
|
||||
[InlineData(nameof(MediaKind.Photo))] // A kind that cannot be resumed, still a defined kind.
|
||||
public void Validate_WhenMediaKindIsTheNameOfADefinedKind_ShouldNotHaveValidationError(string mediaKind)
|
||||
{
|
||||
// Arrange
|
||||
@@ -69,9 +69,9 @@ public class GetResumePointQueryValidatorTests
|
||||
}
|
||||
|
||||
[Theory]
|
||||
[InlineData("musictrack")] // the name of a defined kind, in lower case
|
||||
[InlineData("MUSICTRACK")] // the name of a defined kind, in upper case
|
||||
[InlineData("musicTrack")] // the name of a defined kind, in mixed case
|
||||
[InlineData("musictrack")] // The name of a defined kind, in lower case.
|
||||
[InlineData("MUSICTRACK")] // The name of a defined kind, in upper case.
|
||||
[InlineData("musicTrack")] // The name of a defined kind, in mixed case.
|
||||
public void Validate_WhenMediaKindIsTheNameOfADefinedKindInAnotherCase_ShouldNotHaveValidationError(string mediaKind)
|
||||
{
|
||||
// Arrange
|
||||
@@ -98,10 +98,10 @@ public class GetResumePointQueryValidatorTests
|
||||
}
|
||||
|
||||
[Theory]
|
||||
[InlineData("")] // the media item Id is empty
|
||||
[InlineData(" ")] // the media item Id is whitespace only
|
||||
[InlineData("not-a-guid")] // the media item Id is not a Guid
|
||||
[InlineData("00000000-0000-0000-0000-000000000000")] // the media item Id is the empty Guid
|
||||
[InlineData("")] // The media item Id is empty.
|
||||
[InlineData(" ")] // The media item Id is whitespace only.
|
||||
[InlineData("not-a-guid")] // The media item Id is not a Guid.
|
||||
[InlineData("00000000-0000-0000-0000-000000000000")] // The media item Id is the empty Guid.
|
||||
public void Validate_WhenMediaItemIdIsEmptyOrInvalid_ShouldHaveValidationError(string mediaItemId)
|
||||
{
|
||||
// Arrange
|
||||
|
||||
+15
-15
@@ -35,10 +35,10 @@ public class GetTagConsumptionQueryValidatorTests
|
||||
}
|
||||
|
||||
[Theory]
|
||||
[InlineData("")] // the target user Id is empty
|
||||
[InlineData(" ")] // the target user Id is whitespace only
|
||||
[InlineData("not-a-guid")] // the target user Id is not a Guid
|
||||
[InlineData("00000000-0000-0000-0000-000000000000")] // the target user Id is the empty Guid
|
||||
[InlineData("")] // The target user Id is empty.
|
||||
[InlineData(" ")] // The target user Id is whitespace only.
|
||||
[InlineData("not-a-guid")] // The target user Id is not a Guid.
|
||||
[InlineData("00000000-0000-0000-0000-000000000000")] // The target user Id is the empty Guid.
|
||||
public void Validate_WhenTargetUserIdIsEmptyOrInvalid_ShouldHaveValidationError(string targetUserId)
|
||||
{
|
||||
// Arrange
|
||||
@@ -78,10 +78,10 @@ public class GetTagConsumptionQueryValidatorTests
|
||||
}
|
||||
|
||||
[Theory]
|
||||
[InlineData("")] // the library Id is empty
|
||||
[InlineData(" ")] // the library Id is whitespace only
|
||||
[InlineData("not-a-guid")] // the library Id is not a Guid
|
||||
[InlineData("00000000-0000-0000-0000-000000000000")] // the library Id is the empty Guid
|
||||
[InlineData("")] // The library Id is empty.
|
||||
[InlineData(" ")] // The library Id is whitespace only.
|
||||
[InlineData("not-a-guid")] // The library Id is not a Guid.
|
||||
[InlineData("00000000-0000-0000-0000-000000000000")] // The library Id is the empty Guid.
|
||||
public void Validate_WhenLibraryIdIsEmptyOrInvalid_ShouldHaveValidationError(string libraryId)
|
||||
{
|
||||
// Arrange
|
||||
@@ -147,10 +147,10 @@ public class GetTagConsumptionQueryValidatorTests
|
||||
}
|
||||
|
||||
[Theory]
|
||||
[InlineData(nameof(MediaKind.MusicTrack))] // a kind supported by the current catalogues
|
||||
[InlineData(nameof(MediaKind.Book))] // another kind supported by the current catalogues
|
||||
[InlineData(nameof(MediaKind.Movie))] // a kind without a catalogue, still a defined kind
|
||||
[InlineData(nameof(MediaKind.Photo))] // a kind that every session counts for, still a defined kind
|
||||
[InlineData(nameof(MediaKind.MusicTrack))] // A kind supported by the current catalogues.
|
||||
[InlineData(nameof(MediaKind.Book))] // Another kind supported by the current catalogues.
|
||||
[InlineData(nameof(MediaKind.Movie))] // A kind without a catalogue, still a defined kind.
|
||||
[InlineData(nameof(MediaKind.Photo))] // A kind that every session counts for, still a defined kind.
|
||||
public void Validate_WhenMediaKindIsDefined_ShouldNotHaveValidationError(string mediaKind)
|
||||
{
|
||||
// Arrange
|
||||
@@ -223,9 +223,9 @@ public class GetTagConsumptionQueryValidatorTests
|
||||
}
|
||||
|
||||
[Theory]
|
||||
[InlineData("")] // an empty bound
|
||||
[InlineData("not-a-date")] // a textual value that is not a date
|
||||
[InlineData("2026-13-45T99:99:99")] // a value with out of range components
|
||||
[InlineData("")] // An empty bound.
|
||||
[InlineData("not-a-date")] // A textual value that is not a date.
|
||||
[InlineData("2026-13-45T99:99:99")] // A value with out of range components.
|
||||
public void Validate_WhenADateRangeBoundIsNotAValidDate_ShouldHaveValidationError(string invalidBound)
|
||||
{
|
||||
// Arrange
|
||||
|
||||
+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
|
||||
|
||||
+4
-4
@@ -34,10 +34,10 @@ public class AddPlaylistEntriesCommandValidatorTests
|
||||
}
|
||||
|
||||
[Theory]
|
||||
[InlineData("")] // an empty identifier
|
||||
[InlineData(" ")] // a white-space only identifier
|
||||
[InlineData("not-a-guid")] // an identifier that cannot be parsed
|
||||
[InlineData("00000000-0000-0000-0000-000000000000")] // the empty Guid, which is never a valid playlist
|
||||
[InlineData("")] // An empty identifier.
|
||||
[InlineData(" ")] // A white-space only identifier.
|
||||
[InlineData("not-a-guid")] // An identifier that cannot be parsed.
|
||||
[InlineData("00000000-0000-0000-0000-000000000000")] // The empty Guid, which is never a valid playlist.
|
||||
public void Validate_WhenPlaylistIdIsNotAValidIdentifier_ShouldHaveValidationError(string playlistId)
|
||||
{
|
||||
// Arrange
|
||||
|
||||
+4
-4
@@ -34,10 +34,10 @@ public class AddPlaylistEntryCommandValidatorTests
|
||||
}
|
||||
|
||||
[Theory]
|
||||
[InlineData("")] // an empty identifier
|
||||
[InlineData(" ")] // a white-space only identifier
|
||||
[InlineData("not-a-guid")] // an identifier that cannot be parsed
|
||||
[InlineData("00000000-0000-0000-0000-000000000000")] // the empty Guid, which is never a valid playlist
|
||||
[InlineData("")] // An empty identifier.
|
||||
[InlineData(" ")] // A white-space only identifier.
|
||||
[InlineData("not-a-guid")] // An identifier that cannot be parsed.
|
||||
[InlineData("00000000-0000-0000-0000-000000000000")] // The empty Guid, which is never a valid playlist.
|
||||
public void Validate_WhenPlaylistIdIsNotAValidIdentifier_ShouldHaveValidationError(string playlistId)
|
||||
{
|
||||
// Arrange
|
||||
|
||||
+4
-4
@@ -34,10 +34,10 @@ public class AddPlaylistScopeEntriesCommandValidatorTests
|
||||
}
|
||||
|
||||
[Theory]
|
||||
[InlineData("")] // an empty identifier
|
||||
[InlineData(" ")] // a white-space only identifier
|
||||
[InlineData("not-a-guid")] // an identifier that cannot be parsed
|
||||
[InlineData("00000000-0000-0000-0000-000000000000")] // the empty Guid, which is never a valid playlist
|
||||
[InlineData("")] // An empty identifier.
|
||||
[InlineData(" ")] // A white-space only identifier.
|
||||
[InlineData("not-a-guid")] // An identifier that cannot be parsed.
|
||||
[InlineData("00000000-0000-0000-0000-000000000000")] // The empty Guid, which is never a valid playlist.
|
||||
public void Validate_WhenPlaylistIdIsNotAValidIdentifier_ShouldHaveValidationError(string playlistId)
|
||||
{
|
||||
// Arrange
|
||||
|
||||
+4
-4
@@ -33,10 +33,10 @@ public class DeletePlaylistCommandValidatorTests
|
||||
}
|
||||
|
||||
[Theory]
|
||||
[InlineData("")] // an empty identifier
|
||||
[InlineData(" ")] // a white-space only identifier
|
||||
[InlineData("not-a-guid")] // an identifier that cannot be parsed
|
||||
[InlineData("00000000-0000-0000-0000-000000000000")] // the empty Guid, which is never a valid playlist
|
||||
[InlineData("")] // An empty identifier.
|
||||
[InlineData(" ")] // A white-space only identifier.
|
||||
[InlineData("not-a-guid")] // An identifier that cannot be parsed.
|
||||
[InlineData("00000000-0000-0000-0000-000000000000")] // The empty Guid, which is never a valid playlist.
|
||||
public void Validate_WhenPlaylistIdIsNotAValidIdentifier_ShouldHaveValidationError(string playlistId)
|
||||
{
|
||||
// Arrange
|
||||
|
||||
+8
-8
@@ -33,10 +33,10 @@ public class MovePlaylistEntryCommandValidatorTests
|
||||
}
|
||||
|
||||
[Theory]
|
||||
[InlineData("")] // an empty identifier
|
||||
[InlineData(" ")] // a white-space only identifier
|
||||
[InlineData("not-a-guid")] // an identifier that cannot be parsed
|
||||
[InlineData("00000000-0000-0000-0000-000000000000")] // the empty Guid, which is never a valid playlist
|
||||
[InlineData("")] // An empty identifier.
|
||||
[InlineData(" ")] // A white-space only identifier.
|
||||
[InlineData("not-a-guid")] // An identifier that cannot be parsed.
|
||||
[InlineData("00000000-0000-0000-0000-000000000000")] // The empty Guid, which is never a valid playlist.
|
||||
public void Validate_WhenPlaylistIdIsNotAValidIdentifier_ShouldHaveValidationError(string playlistId)
|
||||
{
|
||||
// Arrange
|
||||
@@ -63,10 +63,10 @@ public class MovePlaylistEntryCommandValidatorTests
|
||||
}
|
||||
|
||||
[Theory]
|
||||
[InlineData("")] // an empty identifier
|
||||
[InlineData(" ")] // a white-space only identifier
|
||||
[InlineData("not-a-guid")] // an identifier that cannot be parsed
|
||||
[InlineData("00000000-0000-0000-0000-000000000000")] // the empty Guid, which is never a valid entry
|
||||
[InlineData("")] // An empty identifier.
|
||||
[InlineData(" ")] // A white-space only identifier.
|
||||
[InlineData("not-a-guid")] // An identifier that cannot be parsed.
|
||||
[InlineData("00000000-0000-0000-0000-000000000000")] // The empty Guid, which is never a valid entry.
|
||||
public void Validate_WhenPlaylistEntryIdIsNotAValidIdentifier_ShouldHaveValidationError(string playlistEntryId)
|
||||
{
|
||||
// Arrange
|
||||
|
||||
+8
-8
@@ -33,10 +33,10 @@ public class RemovePlaylistEntryCommandValidatorTests
|
||||
}
|
||||
|
||||
[Theory]
|
||||
[InlineData("")] // an empty identifier
|
||||
[InlineData(" ")] // a white-space only identifier
|
||||
[InlineData("not-a-guid")] // an identifier that cannot be parsed
|
||||
[InlineData("00000000-0000-0000-0000-000000000000")] // the empty Guid, which is never a valid playlist
|
||||
[InlineData("")] // An empty identifier.
|
||||
[InlineData(" ")] // A white-space only identifier.
|
||||
[InlineData("not-a-guid")] // An identifier that cannot be parsed.
|
||||
[InlineData("00000000-0000-0000-0000-000000000000")] // The empty Guid, which is never a valid playlist.
|
||||
public void Validate_WhenPlaylistIdIsNotAValidIdentifier_ShouldHaveValidationError(string playlistId)
|
||||
{
|
||||
// Arrange
|
||||
@@ -63,10 +63,10 @@ public class RemovePlaylistEntryCommandValidatorTests
|
||||
}
|
||||
|
||||
[Theory]
|
||||
[InlineData("")] // an empty identifier
|
||||
[InlineData(" ")] // a white-space only identifier
|
||||
[InlineData("not-a-guid")] // an identifier that cannot be parsed
|
||||
[InlineData("00000000-0000-0000-0000-000000000000")] // the empty Guid, which is never a valid entry
|
||||
[InlineData("")] // An empty identifier.
|
||||
[InlineData(" ")] // A white-space only identifier.
|
||||
[InlineData("not-a-guid")] // An identifier that cannot be parsed.
|
||||
[InlineData("00000000-0000-0000-0000-000000000000")] // The empty Guid, which is never a valid entry.
|
||||
public void Validate_WhenPlaylistEntryIdIsNotAValidIdentifier_ShouldHaveValidationError(string playlistEntryId)
|
||||
{
|
||||
// Arrange
|
||||
|
||||
+4
-4
@@ -35,10 +35,10 @@ public class UpdatePlaylistCommandValidatorTests
|
||||
}
|
||||
|
||||
[Theory]
|
||||
[InlineData("")] // an empty identifier
|
||||
[InlineData(" ")] // a white-space only identifier
|
||||
[InlineData("not-a-guid")] // an identifier that cannot be parsed
|
||||
[InlineData("00000000-0000-0000-0000-000000000000")] // the empty Guid, which is never a valid playlist
|
||||
[InlineData("")] // An empty identifier.
|
||||
[InlineData(" ")] // A white-space only identifier.
|
||||
[InlineData("not-a-guid")] // An identifier that cannot be parsed.
|
||||
[InlineData("00000000-0000-0000-0000-000000000000")] // The empty Guid, which is never a valid playlist.
|
||||
public void Validate_WhenPlaylistIdIsNotAValidIdentifier_ShouldHaveValidationError(string playlistId)
|
||||
{
|
||||
// Arrange
|
||||
|
||||
+4
-4
@@ -34,10 +34,10 @@ public class GetPlaylistQueryValidatorTests
|
||||
}
|
||||
|
||||
[Theory]
|
||||
[InlineData("")] // the playlist Id is empty
|
||||
[InlineData(" ")] // the playlist Id is whitespace only
|
||||
[InlineData("not-a-guid")] // the playlist Id is not a Guid
|
||||
[InlineData("00000000-0000-0000-0000-000000000000")] // the playlist Id is the empty Guid
|
||||
[InlineData("")] // The playlist Id is empty.
|
||||
[InlineData(" ")] // The playlist Id is whitespace only.
|
||||
[InlineData("not-a-guid")] // The playlist Id is not a Guid.
|
||||
[InlineData("00000000-0000-0000-0000-000000000000")] // The playlist Id is the empty Guid.
|
||||
public void Validate_WhenPlaylistIdIsEmptyOrInvalid_ShouldHaveValidationError(string playlistId)
|
||||
{
|
||||
// Arrange
|
||||
|
||||
+1
-1
@@ -61,7 +61,7 @@ public class GetLibraryArtworkProvidersQueryHandlerTests
|
||||
_mockValidator = Substitute.For<IValidator<GetLibraryArtworkProvidersQuery>>();
|
||||
_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
@@ -61,7 +61,7 @@ public class GetLibraryMetadataProvidersQueryHandlerTests
|
||||
_mockValidator = Substitute.For<IValidator<GetLibraryMetadataProvidersQuery>>();
|
||||
_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);
|
||||
|
||||
+9
-9
@@ -21,9 +21,9 @@ public class AddScheduledJobCommandValidatorTests
|
||||
private readonly AddScheduledJobCommandFixture _addScheduledJobCommandFixture = new();
|
||||
|
||||
[Theory]
|
||||
[InlineData(null)] // null name
|
||||
[InlineData("")] // empty name
|
||||
[InlineData(" ")] // whitespace name
|
||||
[InlineData(null)] // Null name.
|
||||
[InlineData("")] // Empty name.
|
||||
[InlineData(" ")] // Whitespace name.
|
||||
public void Validate_WhenNameIsNullOrWhitespace_ShouldHaveValidationError(string? name)
|
||||
{
|
||||
// Arrange
|
||||
@@ -89,8 +89,8 @@ public class AddScheduledJobCommandValidatorTests
|
||||
}
|
||||
|
||||
[Theory]
|
||||
[InlineData(0)] // interval of zero
|
||||
[InlineData(-1)] // negative interval
|
||||
[InlineData(0)] // Interval of zero.
|
||||
[InlineData(-1)] // Negative interval.
|
||||
public void Validate_WhenIntervalScheduleHasNonPositiveInterval_ShouldHaveValidationError(int intervalMinutes)
|
||||
{
|
||||
// Arrange
|
||||
@@ -132,8 +132,8 @@ public class AddScheduledJobCommandValidatorTests
|
||||
}
|
||||
|
||||
[Theory]
|
||||
[InlineData(-1)] // hour below the allowed range
|
||||
[InlineData(24)] // hour above the allowed range
|
||||
[InlineData(-1)] // Hour below the allowed range.
|
||||
[InlineData(24)] // Hour above the allowed range.
|
||||
public void Validate_WhenDailyScheduleHasOutOfRangeHour_ShouldHaveValidationError(int hour)
|
||||
{
|
||||
// Arrange
|
||||
@@ -150,8 +150,8 @@ public class AddScheduledJobCommandValidatorTests
|
||||
}
|
||||
|
||||
[Theory]
|
||||
[InlineData(-1)] // minute below the allowed range
|
||||
[InlineData(60)] // minute above the allowed range
|
||||
[InlineData(-1)] // Minute below the allowed range.
|
||||
[InlineData(60)] // Minute above the allowed range.
|
||||
public void Validate_WhenDailyScheduleHasOutOfRangeMinute_ShouldHaveValidationError(int minute)
|
||||
{
|
||||
// Arrange
|
||||
|
||||
+6
-6
@@ -20,9 +20,9 @@ public class UpdateSchedulerDisplayPreferencesCommandValidatorTests
|
||||
private readonly UpdateSchedulerDisplayPreferencesCommandFixture _updateSchedulerDisplayPreferencesCommandFixture = new();
|
||||
|
||||
[Theory]
|
||||
[InlineData(0)] // display time span of zero
|
||||
[InlineData(-1)] // negative display time span
|
||||
[InlineData(-100)] // negative display time span far from zero
|
||||
[InlineData(0)] // Display time span of zero.
|
||||
[InlineData(-1)] // Negative display time span.
|
||||
[InlineData(-100)] // Negative display time span far from zero.
|
||||
public void Validate_WhenDisplayTimeSpanIsNotPositive_ShouldHaveValidationError(int displayTimeSpan)
|
||||
{
|
||||
// Arrange
|
||||
@@ -36,9 +36,9 @@ public class UpdateSchedulerDisplayPreferencesCommandValidatorTests
|
||||
}
|
||||
|
||||
[Theory]
|
||||
[InlineData(1)] // minimal positive display time span
|
||||
[InlineData(10)] // default display time span
|
||||
[InlineData(1440)] // a day expressed in minutes
|
||||
[InlineData(1)] // Minimal positive display time span.
|
||||
[InlineData(10)] // Default display time span.
|
||||
[InlineData(1440)] // A day expressed in minutes.
|
||||
public void Validate_WhenDisplayTimeSpanIsPositive_ShouldNotHaveValidationError(int displayTimeSpan)
|
||||
{
|
||||
// Arrange
|
||||
|
||||
+2
-2
@@ -62,8 +62,8 @@ public class ScheduledJobExecutionCompletedDomainEventHandlerTests
|
||||
}
|
||||
|
||||
[Theory]
|
||||
[InlineData(true, ScheduledJobStatus.Active)] // a cycle run returns the scheduled job to its active status
|
||||
[InlineData(false, ScheduledJobStatus.Completed)] // a one time execution completes the scheduled job
|
||||
[InlineData(true, ScheduledJobStatus.Active)] // A cycle run returns the scheduled job to its active status.
|
||||
[InlineData(false, ScheduledJobStatus.Completed)] // A one time execution completes the scheduled job.
|
||||
public async Task HandleAsync_WhenScheduledJobAndExecutionExist_ShouldUpdateBothAndNotify(bool isCycleRun, ScheduledJobStatus expectedStatus)
|
||||
{
|
||||
// Arrange
|
||||
|
||||
+16
-16
@@ -202,12 +202,12 @@ public class ChangePasswordCommandValidatorTests
|
||||
}
|
||||
|
||||
[Theory]
|
||||
[InlineData("password123")] // Missing uppercase and special character
|
||||
[InlineData("PASSWORD123")] // Missing special character
|
||||
[InlineData("Password123")] // Missing special character
|
||||
[InlineData("Password!@#")] // Missing number
|
||||
[InlineData("Pass1!")] // Too short
|
||||
[InlineData("password")] // Missing uppercase, number, and special character
|
||||
[InlineData("password123")] // Missing uppercase and special character.
|
||||
[InlineData("PASSWORD123")] // Missing special character.
|
||||
[InlineData("Password123")] // Missing special character.
|
||||
[InlineData("Password!@#")] // Missing number.
|
||||
[InlineData("Pass1!")] // Too short.
|
||||
[InlineData("password")] // Missing uppercase, number, and special character.
|
||||
public void Validate_WhenCurrentPasswordDoesNotMatchPattern_ShouldHaveValidationError(string password)
|
||||
{
|
||||
// Arrange
|
||||
@@ -222,12 +222,12 @@ public class ChangePasswordCommandValidatorTests
|
||||
}
|
||||
|
||||
[Theory]
|
||||
[InlineData("password123")] // Missing uppercase and special character
|
||||
[InlineData("PASSWORD123")] // Missing special character
|
||||
[InlineData("Password123")] // Missing special character
|
||||
[InlineData("Password!@#")] // Missing number
|
||||
[InlineData("Pass1!")] // Too short
|
||||
[InlineData("password")] // Missing uppercase, number, and special character
|
||||
[InlineData("password123")] // Missing uppercase and special character.
|
||||
[InlineData("PASSWORD123")] // Missing special character.
|
||||
[InlineData("Password123")] // Missing special character.
|
||||
[InlineData("Password!@#")] // Missing number.
|
||||
[InlineData("Pass1!")] // Too short.
|
||||
[InlineData("password")] // Missing uppercase, number, and special character.
|
||||
public void Validate_WhenNewPasswordDoesNotMatchPattern_ShouldHaveValidationError(string password)
|
||||
{
|
||||
// Arrange
|
||||
@@ -242,10 +242,10 @@ public class ChangePasswordCommandValidatorTests
|
||||
}
|
||||
|
||||
[Theory]
|
||||
[InlineData("Password1!")] // Valid password
|
||||
[InlineData("Complex1@Password")] // Valid password
|
||||
[InlineData("MyP@ssw0rd")] // Valid password
|
||||
[InlineData("Abcd123!@#")] // Valid password
|
||||
[InlineData("Password1!")] // Valid password.
|
||||
[InlineData("Complex1@Password")] // Valid password.
|
||||
[InlineData("MyP@ssw0rd")] // Valid password.
|
||||
[InlineData("Abcd123!@#")] // Valid password.
|
||||
public void Validate_WhenPasswordsMatchPattern_ShouldNotHaveValidationError(string password)
|
||||
{
|
||||
// Arrange
|
||||
|
||||
+6
-6
@@ -104,12 +104,12 @@ public class RecoverPasswordCommandValidatorTests
|
||||
}
|
||||
|
||||
[Theory]
|
||||
[InlineData("12345")] // Too short
|
||||
[InlineData("1234567")] // Too long
|
||||
[InlineData("abcdef")] // Contains letters
|
||||
[InlineData("12345a")] // Contains letters
|
||||
[InlineData("12.345")] // Contains special characters
|
||||
[InlineData("12 345")] // Contains whitespace
|
||||
[InlineData("12345")] // Too short.
|
||||
[InlineData("1234567")] // Too long.
|
||||
[InlineData("abcdef")] // Contains letters.
|
||||
[InlineData("12345a")] // Contains letters.
|
||||
[InlineData("12.345")] // Contains special characters.
|
||||
[InlineData("12 345")] // Contains whitespace.
|
||||
public void Validate_WhenTotpCodeIsInvalid_ShouldHaveValidationError(string totpCode)
|
||||
{
|
||||
// Arrange
|
||||
|
||||
+30
-30
@@ -160,12 +160,12 @@ public class RegisterUserCommandValidatorTests
|
||||
}
|
||||
|
||||
[Theory]
|
||||
[InlineData("password123")] // missing uppercase and special character
|
||||
[InlineData("PASSWORD123")] // missing special character
|
||||
[InlineData("Password123")] // missing special character
|
||||
[InlineData("Password!@#")] // missing number
|
||||
[InlineData("Pass1!")] // too short
|
||||
[InlineData("password")] // missing uppercase, number, and special character
|
||||
[InlineData("password123")] // Missing uppercase and special character.
|
||||
[InlineData("PASSWORD123")] // Missing special character.
|
||||
[InlineData("Password123")] // Missing special character.
|
||||
[InlineData("Password!@#")] // Missing number.
|
||||
[InlineData("Pass1!")] // Too short.
|
||||
[InlineData("password")] // Missing uppercase, number, and special character.
|
||||
public void Validate_WhenPasswordDoesNotMatchPattern_ShouldHaveValidationError(string password)
|
||||
{
|
||||
// Arrange
|
||||
@@ -180,10 +180,10 @@ public class RegisterUserCommandValidatorTests
|
||||
}
|
||||
|
||||
[Theory]
|
||||
[InlineData("Password1!")] // valid password
|
||||
[InlineData("Complex1@Password")] // valid password
|
||||
[InlineData("MyP@ssw0rd")] // valid password
|
||||
[InlineData("Abcd123!@#")] // valid password
|
||||
[InlineData("Password1!")] // Valid password.
|
||||
[InlineData("Complex1@Password")] // Valid password.
|
||||
[InlineData("MyP@ssw0rd")] // Valid password.
|
||||
[InlineData("Abcd123!@#")] // Valid password.
|
||||
public void Validate_WhenPasswordMatchesPattern_ShouldNotHaveValidationError(string password)
|
||||
{
|
||||
// Arrange
|
||||
@@ -219,9 +219,9 @@ public class RegisterUserCommandValidatorTests
|
||||
}
|
||||
|
||||
[Theory]
|
||||
[InlineData("a")] // too short
|
||||
[InlineData("ab")] // too short
|
||||
[InlineData("aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")] // too long (256 chars)
|
||||
[InlineData("a")] // Too short.
|
||||
[InlineData("ab")] // Too short.
|
||||
[InlineData("aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")] // Too long (256 chars).
|
||||
public void Validate_WhenUsernameHasInvalidLength_ShouldHaveValidationError(string username)
|
||||
{
|
||||
// Arrange
|
||||
@@ -236,16 +236,16 @@ public class RegisterUserCommandValidatorTests
|
||||
}
|
||||
|
||||
[Theory]
|
||||
[InlineData(".username")] // starts with special character
|
||||
[InlineData("username.")] // ends with special character
|
||||
[InlineData("_username")] // starts with special character
|
||||
[InlineData("username_")] // ends with special character
|
||||
[InlineData("-username")] // starts with special character
|
||||
[InlineData("username-")] // ends with special character
|
||||
[InlineData("user name")] // contains space
|
||||
[InlineData("user@name")] // contains invalid special char
|
||||
[InlineData("user#name")] // contains invalid special char
|
||||
[InlineData("user$name")] // contains invalid special char
|
||||
[InlineData(".username")] // Starts with special character.
|
||||
[InlineData("username.")] // Ends with special character.
|
||||
[InlineData("_username")] // Starts with special character.
|
||||
[InlineData("username_")] // Ends with special character.
|
||||
[InlineData("-username")] // Starts with special character.
|
||||
[InlineData("username-")] // Ends with special character.
|
||||
[InlineData("user name")] // Contains space.
|
||||
[InlineData("user@name")] // Contains invalid special char.
|
||||
[InlineData("user#name")] // Contains invalid special char.
|
||||
[InlineData("user$name")] // Contains invalid special char.
|
||||
public void Validate_WhenUsernameHasInvalidFormat_ShouldHaveValidationError(string username)
|
||||
{
|
||||
// Arrange
|
||||
@@ -260,13 +260,13 @@ public class RegisterUserCommandValidatorTests
|
||||
}
|
||||
|
||||
[Theory]
|
||||
[InlineData("user123")] // basic alphanumeric
|
||||
[InlineData("user.name")] // with dot
|
||||
[InlineData("user_name")] // with underscore
|
||||
[InlineData("user-name")] // with hyphen
|
||||
[InlineData("User.Name123")] // mixed case with special chars and numbers
|
||||
[InlineData("a1b")] // minimum length
|
||||
[InlineData("aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")] // maximum length (255 chars)
|
||||
[InlineData("user123")] // Basic alphanumeric.
|
||||
[InlineData("user.name")] // With dot.
|
||||
[InlineData("user_name")] // With underscore.
|
||||
[InlineData("user-name")] // With hyphen.
|
||||
[InlineData("User.Name123")] // Mixed case with special chars and numbers.
|
||||
[InlineData("a1b")] // Minimum length.
|
||||
[InlineData("aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")] // Maximum length (255 chars).
|
||||
public void Validate_WhenUsernameHasValidFormat_ShouldNotHaveValidationError(string username)
|
||||
{
|
||||
// Arrange
|
||||
|
||||
+8
-8
@@ -193,7 +193,7 @@ public class LoginUserQueryHandlerTests
|
||||
UserEntity user = _userEntityFixture.Create();
|
||||
user.Password = Uri.EscapeDataString(hashedPassword);
|
||||
user.TempPassword = Uri.EscapeDataString(hashedTempPassword);
|
||||
user.TempPasswordCreated = DateTime.UtcNow.AddMinutes(-16); // Expired (more than 15 minutes old)
|
||||
user.TempPasswordCreated = DateTime.UtcNow.AddMinutes(-16); // Expired (more than 15 minutes old).
|
||||
|
||||
LoginUserQuery query = _loginUserQueryFixture.Create(user.Username, password);
|
||||
|
||||
@@ -229,18 +229,18 @@ public class LoginUserQueryHandlerTests
|
||||
UserEntity user = _userEntityFixture.Create();
|
||||
user.Password = Uri.EscapeDataString(hashedPassword);
|
||||
user.TempPassword = Uri.EscapeDataString(hashedTempPassword);
|
||||
// Set temp password created time to 10 minutes ago (still valid)
|
||||
// Set temp password created time to 10 minutes ago (still valid).
|
||||
user.TempPasswordCreated = DateTime.UtcNow.AddMinutes(-10);
|
||||
user.TotpSecret = null; // Ensure no TOTP validation is needed
|
||||
user.TotpSecret = null; // Ensure no TOTP validation is needed.
|
||||
|
||||
LoginUserQuery query = _loginUserQueryFixture.Create(user.Username, password);
|
||||
|
||||
_mockUserRepository.GetByUsernameAsync(user.Username, Arg.Any<CancellationToken>())
|
||||
.Returns(Result.From<UserEntity?>(user));
|
||||
_mockHashService.CheckStringAgainstHash(password, hashedPassword)
|
||||
.Returns(false); // Regular password check fails
|
||||
.Returns(false); // Regular password check fails.
|
||||
_mockHashService.CheckStringAgainstHash(password, hashedTempPassword)
|
||||
.Returns(true); // Temp password check succeeds
|
||||
.Returns(true); // Temp password check succeeds.
|
||||
_mockJwtTokenGenerator.GenerateToken(user.Id.ToString(), user.Username)
|
||||
.Returns(jwtToken);
|
||||
|
||||
@@ -344,16 +344,16 @@ public class LoginUserQueryHandlerTests
|
||||
UserEntity user = _userEntityFixture.Create();
|
||||
user.Password = Uri.EscapeDataString(hashedPassword);
|
||||
user.TempPassword = Uri.EscapeDataString(hashedTempPassword);
|
||||
user.TempPasswordCreated = DateTime.UtcNow.AddMinutes(-10); // Valid timeframe
|
||||
user.TempPasswordCreated = DateTime.UtcNow.AddMinutes(-10); // Valid timeframe.
|
||||
|
||||
LoginUserQuery query = _loginUserQueryFixture.Create(user.Username, password);
|
||||
|
||||
_mockUserRepository.GetByUsernameAsync(user.Username, Arg.Any<CancellationToken>())
|
||||
.Returns(Result.From<UserEntity?>(user));
|
||||
_mockHashService.CheckStringAgainstHash(password, hashedPassword)
|
||||
.Returns(false); // Regular password check fails
|
||||
.Returns(false); // Regular password check fails.
|
||||
_mockHashService.CheckStringAgainstHash(password, hashedTempPassword)
|
||||
.Returns(false); // Temp password check also fails
|
||||
.Returns(false); // Temp password check also fails.
|
||||
|
||||
// Act
|
||||
Result<LoginResponse> result = await _sut.HandleAsync(query, CancellationToken.None);
|
||||
|
||||
+16
-16
@@ -104,12 +104,12 @@ public class LoginUserQueryValidatorTests
|
||||
}
|
||||
|
||||
[Theory]
|
||||
[InlineData("password123")] // Missing uppercase and special character
|
||||
[InlineData("PASSWORD123")] // Missing special character
|
||||
[InlineData("Password123")] // Missing special character
|
||||
[InlineData("Password!@#")] // Missing number
|
||||
[InlineData("Pass1!")] // Too short
|
||||
[InlineData("password")] // Missing uppercase, number, and special character
|
||||
[InlineData("password123")] // Missing uppercase and special character.
|
||||
[InlineData("PASSWORD123")] // Missing special character.
|
||||
[InlineData("Password123")] // Missing special character.
|
||||
[InlineData("Password!@#")] // Missing number.
|
||||
[InlineData("Pass1!")] // Too short.
|
||||
[InlineData("password")] // Missing uppercase, number, and special character.
|
||||
public void Validate_WhenPasswordDoesNotMatchPattern_ShouldHaveValidationError(string password)
|
||||
{
|
||||
// Arrange
|
||||
@@ -124,10 +124,10 @@ public class LoginUserQueryValidatorTests
|
||||
}
|
||||
|
||||
[Theory]
|
||||
[InlineData("Password1!")] // Valid password
|
||||
[InlineData("Complex1@Password")] // Valid password
|
||||
[InlineData("MyP@ssw0rd")] // Valid password
|
||||
[InlineData("Abcd123!@#")] // Valid password
|
||||
[InlineData("Password1!")] // Valid password.
|
||||
[InlineData("Complex1@Password")] // Valid password.
|
||||
[InlineData("MyP@ssw0rd")] // Valid password.
|
||||
[InlineData("Abcd123!@#")] // Valid password.
|
||||
public void Validate_WhenPasswordMatchesPattern_ShouldNotHaveValidationError(string password)
|
||||
{
|
||||
// Arrange
|
||||
@@ -142,12 +142,12 @@ public class LoginUserQueryValidatorTests
|
||||
}
|
||||
|
||||
[Theory]
|
||||
[InlineData("12345")] // Too short
|
||||
[InlineData("1234567")] // Too long
|
||||
[InlineData("abcdef")] // Contains letters
|
||||
[InlineData("12345a")] // Contains letters
|
||||
[InlineData("12.345")] // Contains special characters
|
||||
[InlineData("12 345")] // Contains whitespace
|
||||
[InlineData("12345")] // Too short.
|
||||
[InlineData("1234567")] // Too long.
|
||||
[InlineData("abcdef")] // Contains letters.
|
||||
[InlineData("12345a")] // Contains letters.
|
||||
[InlineData("12.345")] // Contains special characters.
|
||||
[InlineData("12 345")] // Contains whitespace.
|
||||
public void Validate_WhenTotpCodeIsInvalid_ShouldHaveValidationError(string totpCode)
|
||||
{
|
||||
// Arrange
|
||||
|
||||
+9
-9
@@ -34,9 +34,9 @@ public class UpdatePlaybackStateCommandValidatorTests
|
||||
}
|
||||
|
||||
[Theory]
|
||||
[InlineData(-0.01)] // just below the minimum
|
||||
[InlineData(-1.0)] // well below the minimum
|
||||
[InlineData(double.MinValue)] // far below the minimum
|
||||
[InlineData(-0.01)] // Just below the minimum.
|
||||
[InlineData(-1.0)] // Well below the minimum.
|
||||
[InlineData(double.MinValue)] // Far below the minimum.
|
||||
public void Validate_WhenVolumeIsBelowZero_ShouldHaveRangeError(double volume)
|
||||
{
|
||||
// Arrange
|
||||
@@ -50,9 +50,9 @@ public class UpdatePlaybackStateCommandValidatorTests
|
||||
}
|
||||
|
||||
[Theory]
|
||||
[InlineData(1.01)] // just above the maximum
|
||||
[InlineData(2.0)] // well above the maximum
|
||||
[InlineData(double.MaxValue)] // far above the maximum
|
||||
[InlineData(1.01)] // Just above the maximum.
|
||||
[InlineData(2.0)] // Well above the maximum.
|
||||
[InlineData(double.MaxValue)] // Far above the maximum.
|
||||
public void Validate_WhenVolumeIsAboveOne_ShouldHaveRangeError(double volume)
|
||||
{
|
||||
// Arrange
|
||||
@@ -66,9 +66,9 @@ public class UpdatePlaybackStateCommandValidatorTests
|
||||
}
|
||||
|
||||
[Theory]
|
||||
[InlineData(0.0)] // the minimum
|
||||
[InlineData(0.5)] // a middle value
|
||||
[InlineData(1.0)] // the maximum
|
||||
[InlineData(0.0)] // The minimum.
|
||||
[InlineData(0.5)] // A middle value.
|
||||
[InlineData(1.0)] // The maximum.
|
||||
public void Validate_WhenVolumeIsInRange_ShouldNotHaveRangeError(double volume)
|
||||
{
|
||||
// Arrange
|
||||
|
||||
+44
-44
@@ -170,8 +170,8 @@ public class UpdateUserSettingsCommandValidatorTests
|
||||
}
|
||||
|
||||
[Theory]
|
||||
[InlineData(999)] // a value that is not a defined member of the enumeration
|
||||
[InlineData(-1)] // a negative value that is not a defined member of the enumeration
|
||||
[InlineData(999)] // A value that is not a defined member of the enumeration.
|
||||
[InlineData(-1)] // A negative value that is not a defined member of the enumeration.
|
||||
public void Validate_WhenVuMeterOrientationIsNotDefined_ShouldHaveValidationError(int vuMeterOrientationValue)
|
||||
{
|
||||
// Arrange
|
||||
@@ -201,10 +201,10 @@ public class UpdateUserSettingsCommandValidatorTests
|
||||
}
|
||||
|
||||
[Theory]
|
||||
[InlineData(0)] // below the minimum
|
||||
[InlineData(-1)] // negative
|
||||
[InlineData(129)] // above the maximum
|
||||
[InlineData(int.MaxValue)] // far above the maximum
|
||||
[InlineData(0)] // Below the minimum.
|
||||
[InlineData(-1)] // Negative.
|
||||
[InlineData(129)] // Above the maximum.
|
||||
[InlineData(int.MaxValue)] // Far above the maximum.
|
||||
public void Validate_WhenVuMeterSegmentCountIsOutOfRange_ShouldHaveValidationError(int vuMeterSegmentCount)
|
||||
{
|
||||
// Arrange
|
||||
@@ -218,9 +218,9 @@ public class UpdateUserSettingsCommandValidatorTests
|
||||
}
|
||||
|
||||
[Theory]
|
||||
[InlineData(1)] // the minimum
|
||||
[InlineData(64)] // a middle value
|
||||
[InlineData(128)] // the maximum
|
||||
[InlineData(1)] // The minimum.
|
||||
[InlineData(64)] // A middle value.
|
||||
[InlineData(128)] // The maximum.
|
||||
public void Validate_WhenVuMeterSegmentCountIsInRange_ShouldNotHaveValidationError(int vuMeterSegmentCount)
|
||||
{
|
||||
// Arrange
|
||||
@@ -234,9 +234,9 @@ public class UpdateUserSettingsCommandValidatorTests
|
||||
}
|
||||
|
||||
[Theory]
|
||||
[InlineData(-1)] // below the minimum
|
||||
[InlineData(33)] // above the maximum
|
||||
[InlineData(int.MinValue)] // far below the minimum
|
||||
[InlineData(-1)] // Below the minimum.
|
||||
[InlineData(33)] // Above the maximum.
|
||||
[InlineData(int.MinValue)] // Far below the minimum.
|
||||
public void Validate_WhenVuMeterSegmentGapIsOutOfRange_ShouldHaveValidationError(int vuMeterSegmentGap)
|
||||
{
|
||||
// Arrange
|
||||
@@ -250,9 +250,9 @@ public class UpdateUserSettingsCommandValidatorTests
|
||||
}
|
||||
|
||||
[Theory]
|
||||
[InlineData(0)] // the minimum
|
||||
[InlineData(16)] // a middle value
|
||||
[InlineData(32)] // the maximum
|
||||
[InlineData(0)] // The minimum.
|
||||
[InlineData(16)] // A middle value.
|
||||
[InlineData(32)] // The maximum.
|
||||
public void Validate_WhenVuMeterSegmentGapIsInRange_ShouldNotHaveValidationError(int vuMeterSegmentGap)
|
||||
{
|
||||
// Arrange
|
||||
@@ -266,9 +266,9 @@ public class UpdateUserSettingsCommandValidatorTests
|
||||
}
|
||||
|
||||
[Theory]
|
||||
[InlineData(-0.01)] // just below the minimum
|
||||
[InlineData(1.01)] // just above the maximum
|
||||
[InlineData(double.MinValue)] // far below the minimum
|
||||
[InlineData(-0.01)] // Just below the minimum.
|
||||
[InlineData(1.01)] // Just above the maximum.
|
||||
[InlineData(double.MinValue)] // Far below the minimum.
|
||||
public void Validate_WhenVuMeterMediumThresholdIsOutOfRange_ShouldHaveValidationError(double vuMeterMediumThreshold)
|
||||
{
|
||||
// Arrange
|
||||
@@ -284,9 +284,9 @@ public class UpdateUserSettingsCommandValidatorTests
|
||||
}
|
||||
|
||||
[Theory]
|
||||
[InlineData(0.0)] // the minimum
|
||||
[InlineData(0.5)] // a middle value
|
||||
[InlineData(1.0)] // the maximum
|
||||
[InlineData(0.0)] // The minimum.
|
||||
[InlineData(0.5)] // A middle value.
|
||||
[InlineData(1.0)] // The maximum.
|
||||
public void Validate_WhenVuMeterMediumThresholdIsInRange_ShouldNotHaveValidationError(double vuMeterMediumThreshold)
|
||||
{
|
||||
// Arrange
|
||||
@@ -302,9 +302,9 @@ public class UpdateUserSettingsCommandValidatorTests
|
||||
}
|
||||
|
||||
[Theory]
|
||||
[InlineData(-0.01)] // just below the minimum
|
||||
[InlineData(1.01)] // just above the maximum
|
||||
[InlineData(double.MaxValue)] // far above the maximum
|
||||
[InlineData(-0.01)] // Just below the minimum.
|
||||
[InlineData(1.01)] // Just above the maximum.
|
||||
[InlineData(double.MaxValue)] // Far above the maximum.
|
||||
public void Validate_WhenVuMeterHighThresholdIsOutOfRange_ShouldHaveValidationError(double vuMeterHighThreshold)
|
||||
{
|
||||
// Arrange
|
||||
@@ -365,8 +365,8 @@ public class UpdateUserSettingsCommandValidatorTests
|
||||
}
|
||||
|
||||
[Theory]
|
||||
[InlineData(0.5, 0.5)] // the thresholds are equal
|
||||
[InlineData(0.4, 0.9)] // the high threshold is greater than the medium one
|
||||
[InlineData(0.5, 0.5)] // The thresholds are equal.
|
||||
[InlineData(0.4, 0.9)] // The high threshold is greater than the medium one.
|
||||
public void Validate_WhenVuMeterHighThresholdIsGreaterThanOrEqualToMediumThreshold_ShouldNotHaveValidationError(
|
||||
double vuMeterMediumThreshold,
|
||||
double vuMeterHighThreshold)
|
||||
@@ -399,9 +399,9 @@ public class UpdateUserSettingsCommandValidatorTests
|
||||
}
|
||||
|
||||
[Theory]
|
||||
[InlineData(-1)] // below the minimum
|
||||
[InlineData(10001)] // above the maximum
|
||||
[InlineData(int.MinValue)] // far below the minimum
|
||||
[InlineData(-1)] // Below the minimum.
|
||||
[InlineData(10001)] // Above the maximum.
|
||||
[InlineData(int.MinValue)] // Far below the minimum.
|
||||
public void Validate_WhenVuMeterPeakHoldDurationIsOutOfRange_ShouldHaveValidationError(int vuMeterPeakHoldDurationInMilliseconds)
|
||||
{
|
||||
// Arrange
|
||||
@@ -416,9 +416,9 @@ public class UpdateUserSettingsCommandValidatorTests
|
||||
}
|
||||
|
||||
[Theory]
|
||||
[InlineData(0)] // the minimum
|
||||
[InlineData(650)] // a middle value
|
||||
[InlineData(10000)] // the maximum
|
||||
[InlineData(0)] // The minimum.
|
||||
[InlineData(650)] // A middle value.
|
||||
[InlineData(10000)] // The maximum.
|
||||
public void Validate_WhenVuMeterPeakHoldDurationIsInRange_ShouldNotHaveValidationError(int vuMeterPeakHoldDurationInMilliseconds)
|
||||
{
|
||||
// Arrange
|
||||
@@ -433,9 +433,9 @@ public class UpdateUserSettingsCommandValidatorTests
|
||||
}
|
||||
|
||||
[Theory]
|
||||
[InlineData(-0.01)] // just below the minimum
|
||||
[InlineData(100.01)] // just above the maximum
|
||||
[InlineData(double.MinValue)] // far below the minimum
|
||||
[InlineData(-0.01)] // Just below the minimum.
|
||||
[InlineData(100.01)] // Just above the maximum.
|
||||
[InlineData(double.MinValue)] // Far below the minimum.
|
||||
public void Validate_WhenVuMeterReleasePerSecondIsOutOfRange_ShouldHaveValidationError(double vuMeterReleasePerSecond)
|
||||
{
|
||||
// Arrange
|
||||
@@ -450,9 +450,9 @@ public class UpdateUserSettingsCommandValidatorTests
|
||||
}
|
||||
|
||||
[Theory]
|
||||
[InlineData(0.0)] // the minimum
|
||||
[InlineData(3.0)] // a middle value
|
||||
[InlineData(100.0)] // the maximum
|
||||
[InlineData(0.0)] // The minimum.
|
||||
[InlineData(3.0)] // A middle value.
|
||||
[InlineData(100.0)] // The maximum.
|
||||
public void Validate_WhenVuMeterReleasePerSecondIsInRange_ShouldNotHaveValidationError(double vuMeterReleasePerSecond)
|
||||
{
|
||||
// Arrange
|
||||
@@ -467,9 +467,9 @@ public class UpdateUserSettingsCommandValidatorTests
|
||||
}
|
||||
|
||||
[Theory]
|
||||
[InlineData(-0.01)] // just below the minimum
|
||||
[InlineData(100.01)] // just above the maximum
|
||||
[InlineData(double.MaxValue)] // far above the maximum
|
||||
[InlineData(-0.01)] // Just below the minimum.
|
||||
[InlineData(100.01)] // Just above the maximum.
|
||||
[InlineData(double.MaxValue)] // Far above the maximum.
|
||||
public void Validate_WhenVuMeterPeakReleasePerSecondIsOutOfRange_ShouldHaveValidationError(double vuMeterPeakReleasePerSecond)
|
||||
{
|
||||
// Arrange
|
||||
@@ -484,9 +484,9 @@ public class UpdateUserSettingsCommandValidatorTests
|
||||
}
|
||||
|
||||
[Theory]
|
||||
[InlineData(0.0)] // the minimum
|
||||
[InlineData(0.65)] // a middle value
|
||||
[InlineData(100.0)] // the maximum
|
||||
[InlineData(0.0)] // The minimum.
|
||||
[InlineData(0.65)] // A middle value.
|
||||
[InlineData(100.0)] // The maximum.
|
||||
public void Validate_WhenVuMeterPeakReleasePerSecondIsInRange_ShouldNotHaveValidationError(double vuMeterPeakReleasePerSecond)
|
||||
{
|
||||
// Arrange
|
||||
|
||||
Reference in new issue
Block a user