mirror of
https://github.com/BinaryAlley/Nemera.git
synced 2026-12-03 00:11:10 +00:00
Removes the umbrella include flag from the fixtures and their consumers
This commit is contained in:
1 parent
ab5cbfb949
commit
4d96fe10dd
43 files changed
+930
-349
No files matched your search
+10
-1
@@ -63,7 +63,16 @@ public class AddTrackRequestMappingTests
|
||||
AddTrackRequest request = _addTrackRequestFixture.Create(
|
||||
path: "/music/queen/bohemian-rhapsody.flac",
|
||||
metadata: _audioMetadataDtoFixture.Create(title: "Love of My Life"),
|
||||
includeOptionalProperties: false);
|
||||
includeDiscNumber: false,
|
||||
includeScript: false,
|
||||
includeKey: false,
|
||||
includeBpm: false,
|
||||
includeWork: false,
|
||||
includeMusicBrainzRecordingId: false,
|
||||
includeMusicBrainzTrackId: false,
|
||||
includeMusicBrainzWorkId: false,
|
||||
includeMoods: false,
|
||||
includeIsrcs: false);
|
||||
|
||||
// Act
|
||||
AddTrackCommand result = request.ToCommand(Guid.NewGuid().ToString(), Guid.NewGuid().ToString(), Guid.NewGuid().ToString());
|
||||
|
||||
+1
-1
@@ -84,7 +84,7 @@ public class UpdateTrackCommandMappingTests
|
||||
Guid libraryId = Guid.NewGuid();
|
||||
(Artist artist, Guid albumId, Guid trackId) = CreateDomainArtist(libraryId);
|
||||
string updatedPath = "/music/queen/a-night-at-the-opera/03-you-re-my-best-friend.flac";
|
||||
UpdateTrackCommand command = _updateTrackCommandFixture.Create(libraryId: libraryId.ToString(), artistId: artist.Id.Value.ToString(), albumId: albumId.ToString(), trackId: trackId.ToString(), path: updatedPath, includeOptionalProperties: false, contributors: [], ratings: []);
|
||||
UpdateTrackCommand command = _updateTrackCommandFixture.Create(libraryId: libraryId.ToString(), artistId: artist.Id.Value.ToString(), albumId: albumId.ToString(), trackId: trackId.ToString(), path: updatedPath, includeDiscNumber: false, includeScript: false, includeKey: false, includeBpm: false, includeWork: false, includeMusicBrainzRecordingId: false, includeMusicBrainzTrackId: false, includeMusicBrainzWorkId: false, includeMoods: false, includeIsrcs: false, contributors: [], ratings: []);
|
||||
|
||||
// Act
|
||||
Result<Artist> result = command.ToDomainEntity(artist);
|
||||
|
||||
+21
-2
@@ -63,7 +63,19 @@ public class UpdateTrackRequestMappingTests
|
||||
Guid artistId = Guid.NewGuid();
|
||||
Guid albumId = Guid.NewGuid();
|
||||
Guid trackId = Guid.NewGuid();
|
||||
UpdateTrackRequest request = _updateTrackRequestFixture.Create(includeOptionalProperties: false, contributors: [], ratings: []);
|
||||
UpdateTrackRequest request = _updateTrackRequestFixture.Create(
|
||||
includeDiscNumber: false,
|
||||
includeScript: false,
|
||||
includeKey: false,
|
||||
includeBpm: false,
|
||||
includeWork: false,
|
||||
includeMusicBrainzRecordingId: false,
|
||||
includeMusicBrainzTrackId: false,
|
||||
includeMusicBrainzWorkId: false,
|
||||
includeMoods: false,
|
||||
includeIsrcs: false,
|
||||
contributors: [],
|
||||
ratings: []);
|
||||
|
||||
// Act
|
||||
UpdateTrackCommand result = request.ToCommand(libraryId.ToString(), artistId.ToString(), albumId.ToString(), trackId.ToString());
|
||||
@@ -103,7 +115,14 @@ public class UpdateTrackRequestMappingTests
|
||||
isrcs: [new("GBUM71029604")],
|
||||
contributors: [new(Guid.NewGuid(), MediaContributorRole.Vocals)],
|
||||
ratings: [new(4.5m, 5m, AudioRatingSource.MusicBrainz, 1000)],
|
||||
includeOptionalProperties: false);
|
||||
includeDiscNumber: false,
|
||||
includeScript: false,
|
||||
includeKey: false,
|
||||
includeBpm: false,
|
||||
includeWork: false,
|
||||
includeMusicBrainzRecordingId: false,
|
||||
includeMusicBrainzTrackId: false,
|
||||
includeMusicBrainzWorkId: false);
|
||||
|
||||
// Act
|
||||
UpdateTrackCommand result = request.ToCommand(libraryId.ToString(), artistId.ToString(), albumId.ToString(), trackId.ToString());
|
||||
|
||||
+13
-2
@@ -62,7 +62,18 @@ public class AddBookCommandMappingTests
|
||||
isbns: [],
|
||||
contributors: [],
|
||||
ratings: [],
|
||||
includeOptionalProperties: false);
|
||||
includeFormat: false,
|
||||
includeEdition: false,
|
||||
includeVolumeNumber: false,
|
||||
includeAsin: false,
|
||||
includeGoodreadsId: false,
|
||||
includeLccn: false,
|
||||
includeOclcNumber: false,
|
||||
includeOpenLibraryId: false,
|
||||
includeLibraryThingId: false,
|
||||
includeGoogleBooksId: false,
|
||||
includeBarnesAndNobleId: false,
|
||||
includeAppleBooksId: false);
|
||||
|
||||
// Act
|
||||
Result<Book> result = command.ToDomainEntity(libraryId);
|
||||
@@ -92,7 +103,7 @@ public class AddBookCommandMappingTests
|
||||
public void ToDomainEntity_WhenRatingCreationFails_ShouldReturnError()
|
||||
{
|
||||
// Arrange
|
||||
AddBookCommand command = _commandBookFixture.Create(ratings: [_bookRatingDtoFixture.Create(value: -1, maxValue: 5, includeOptionalProperties: false)]);
|
||||
AddBookCommand command = _commandBookFixture.Create(ratings: [_bookRatingDtoFixture.Create(value: -1, maxValue: 5, includeSource: false, includeVoteCount: false)]);
|
||||
|
||||
// Act
|
||||
Result<Book> result = command.ToDomainEntity(Guid.NewGuid());
|
||||
|
||||
+27
-2
@@ -64,7 +64,21 @@ public class AddBookRequestMappingTests
|
||||
AddBookRequest request = _requestFixture.Create(
|
||||
path: "/books/test.epub",
|
||||
metadata: _writtenContentMetadataDtoFixture.Create(title: "Test Book"),
|
||||
includeOptionalProperties: false
|
||||
includeFormat: false,
|
||||
includeEdition: false,
|
||||
includeVolumeNumber: false,
|
||||
includeAsin: false,
|
||||
includeGoodreadsId: false,
|
||||
includeLccn: false,
|
||||
includeOclcNumber: false,
|
||||
includeOpenLibraryId: false,
|
||||
includeLibraryThingId: false,
|
||||
includeGoogleBooksId: false,
|
||||
includeBarnesAndNobleId: false,
|
||||
includeAppleBooksId: false,
|
||||
includeIsbns: false,
|
||||
includeRatings: false,
|
||||
includeContributors: false
|
||||
);
|
||||
|
||||
// Act
|
||||
@@ -105,7 +119,18 @@ public class AddBookRequestMappingTests
|
||||
_mediaContributorReferenceDtoFixture.Create(role: MediaContributorRole.Author)
|
||||
],
|
||||
ratings: [new(4.5m, 5m, BookRatingSource.Goodreads, 1000)],
|
||||
includeOptionalProperties: false
|
||||
includeFormat: false,
|
||||
includeEdition: false,
|
||||
includeVolumeNumber: false,
|
||||
includeAsin: false,
|
||||
includeGoodreadsId: false,
|
||||
includeLccn: false,
|
||||
includeOclcNumber: false,
|
||||
includeOpenLibraryId: false,
|
||||
includeLibraryThingId: false,
|
||||
includeGoogleBooksId: false,
|
||||
includeBarnesAndNobleId: false,
|
||||
includeAppleBooksId: false
|
||||
);
|
||||
|
||||
// Act
|
||||
|
||||
+10
-5
@@ -24,6 +24,7 @@ public class BookMetadataDtoMappingTests
|
||||
private readonly BookFixture _bookFixture = new();
|
||||
private readonly BookMetadataDtoFixture _bookMetadataDtoFixture = new();
|
||||
private readonly GenreDtoFixture _genreDtoFixture = new();
|
||||
private readonly ReleaseInfoDtoFixture _releaseInfoDtoFixture = new();
|
||||
|
||||
[Fact]
|
||||
public void ApplyMetadata_WhenCalledWithValidMetadata_ShouldApplyItToTheBook()
|
||||
@@ -76,7 +77,7 @@ public class BookMetadataDtoMappingTests
|
||||
{
|
||||
// Arrange
|
||||
Book book = _bookFixture.Create();
|
||||
BookMetadataDto metadata = _bookMetadataDtoFixture.Create(title: title, includeOptionalProperties: false);
|
||||
BookMetadataDto metadata = _bookMetadataDtoFixture.Create(includeTitle: title is not null, title: title, includeReleaseInfo: false, includeGenres: false, includeTags: false, includeLanguage: false, includeFormat: false, includeVolumeNumber: false);
|
||||
|
||||
// Act
|
||||
Result<Success> result = book.ApplyMetadata(metadata);
|
||||
@@ -91,7 +92,7 @@ public class BookMetadataDtoMappingTests
|
||||
{
|
||||
// Arrange
|
||||
Book book = _bookFixture.Create();
|
||||
BookMetadataDto metadata = _bookMetadataDtoFixture.Create(title: "A valid title", includeOptionalProperties: false);
|
||||
BookMetadataDto metadata = _bookMetadataDtoFixture.Create(title: "A valid title", includeReleaseInfo: false, includeGenres: false, includeTags: false, includeLanguage: false, includeFormat: false, includeVolumeNumber: false);
|
||||
|
||||
// Act
|
||||
Result<Success> result = book.ApplyMetadata(metadata);
|
||||
@@ -108,7 +109,7 @@ public class BookMetadataDtoMappingTests
|
||||
Book book = _bookFixture.Create();
|
||||
BookMetadataDto metadata = _bookMetadataDtoFixture.Create(
|
||||
title: "A valid title",
|
||||
releaseInfo: new ReleaseInfoDto(new DateOnly(2000, 1, 1), 1999, null, null, null, null));
|
||||
releaseInfo: _releaseInfoDtoFixture.Create(originalReleaseDate: new DateOnly(2000, 1, 1), originalReleaseYear: 1999));
|
||||
|
||||
// Act
|
||||
Result<Success> result = book.ApplyMetadata(metadata);
|
||||
@@ -173,8 +174,12 @@ public class BookMetadataDtoMappingTests
|
||||
Book book = _bookFixture.Create();
|
||||
BookMetadataDto metadata = _bookMetadataDtoFixture.Create(
|
||||
title: "A valid title",
|
||||
releaseInfo: new ReleaseInfoDto(new DateOnly(2000, 1, 1), 2000, null, null, null, null),
|
||||
includeOptionalProperties: false);
|
||||
releaseInfo: _releaseInfoDtoFixture.Create(originalReleaseDate: new DateOnly(2000, 1, 1), originalReleaseYear: 2000),
|
||||
includeGenres: false,
|
||||
includeTags: false,
|
||||
includeLanguage: false,
|
||||
includeFormat: false,
|
||||
includeVolumeNumber: false);
|
||||
|
||||
// Act
|
||||
Result<Success> result = book.ApplyMetadata(metadata);
|
||||
|
||||
+13
-2
@@ -72,7 +72,18 @@ public class UpdateBookCommandMappingTests
|
||||
isbns: [],
|
||||
contributors: [],
|
||||
ratings: [],
|
||||
includeOptionalProperties: false);
|
||||
includeFormat: false,
|
||||
includeEdition: false,
|
||||
includeVolumeNumber: false,
|
||||
includeAsin: false,
|
||||
includeGoodreadsId: false,
|
||||
includeLccn: false,
|
||||
includeOclcNumber: false,
|
||||
includeOpenLibraryId: false,
|
||||
includeLibraryThingId: false,
|
||||
includeGoogleBooksId: false,
|
||||
includeBarnesAndNobleId: false,
|
||||
includeAppleBooksId: false);
|
||||
BookEntity existingBook = _bookEntityFixture.Create(id: bookId, libraryId: libraryId, path: "/books/the-book.epub");
|
||||
|
||||
// Act
|
||||
@@ -104,7 +115,7 @@ public class UpdateBookCommandMappingTests
|
||||
public void ToDomainEntity_WhenRatingCreationFails_ShouldReturnError()
|
||||
{
|
||||
// Arrange
|
||||
UpdateBookCommand command = _commandBookFixture.Create(ratings: [_bookRatingDtoFixture.Create(value: -1, maxValue: 5, includeOptionalProperties: false)]);
|
||||
UpdateBookCommand command = _commandBookFixture.Create(ratings: [_bookRatingDtoFixture.Create(value: -1, maxValue: 5, includeSource: false, includeVoteCount: false)]);
|
||||
BookEntity existingBook = _bookEntityFixture.Create();
|
||||
|
||||
// Act
|
||||
|
||||
+14
-3
@@ -61,7 +61,7 @@ public class UpdateBookRequestMappingTests
|
||||
// Arrange
|
||||
Guid libraryId = Guid.NewGuid();
|
||||
Guid bookId = Guid.NewGuid();
|
||||
UpdateBookRequest request = _requestFixture.Create(includeOptionalProperties: false);
|
||||
UpdateBookRequest request = _requestFixture.Create(includeFormat: false, includeEdition: false, includeVolumeNumber: false, includeAsin: false, includeGoodreadsId: false, includeLccn: false, includeOclcNumber: false, includeOpenLibraryId: false, includeLibraryThingId: false, includeGoogleBooksId: false, includeBarnesAndNobleId: false, includeAppleBooksId: false, includeIsbns: false, includeRatings: false, includeContributors: false);
|
||||
|
||||
// Act
|
||||
UpdateBookCommand result = request.ToCommand(libraryId.ToString(), bookId.ToString());
|
||||
@@ -102,7 +102,18 @@ public class UpdateBookRequestMappingTests
|
||||
_mediaContributorReferenceDtoFixture.Create(role: MediaContributorRole.Author)
|
||||
],
|
||||
ratings: [new(4.5m, 5m, BookRatingSource.Goodreads, 1000)],
|
||||
includeOptionalProperties: false
|
||||
includeFormat: false,
|
||||
includeEdition: false,
|
||||
includeVolumeNumber: false,
|
||||
includeAsin: false,
|
||||
includeGoodreadsId: false,
|
||||
includeLccn: false,
|
||||
includeOclcNumber: false,
|
||||
includeOpenLibraryId: false,
|
||||
includeLibraryThingId: false,
|
||||
includeGoogleBooksId: false,
|
||||
includeBarnesAndNobleId: false,
|
||||
includeAppleBooksId: false
|
||||
);
|
||||
|
||||
// Act
|
||||
@@ -119,7 +130,7 @@ public class UpdateBookRequestMappingTests
|
||||
public void ToCommand_WhenRouteValuesAreNotParseable_ShouldMapThemAsIs()
|
||||
{
|
||||
// Arrange
|
||||
UpdateBookRequest request = _requestFixture.Create(includeOptionalProperties: false);
|
||||
UpdateBookRequest request = _requestFixture.Create(includeFormat: false, includeEdition: false, includeVolumeNumber: false, includeAsin: false, includeGoodreadsId: false, includeLccn: false, includeOclcNumber: false, includeOpenLibraryId: false, includeLibraryThingId: false, includeGoogleBooksId: false, includeBarnesAndNobleId: false, includeAppleBooksId: false, includeIsbns: false, includeRatings: false, includeContributors: false);
|
||||
|
||||
// Act
|
||||
UpdateBookCommand result = request.ToCommand("not-a-library-guid", "not-a-guid");
|
||||
|
||||
+3
-3
@@ -56,7 +56,7 @@ public class BookRatingDtoMappingTests
|
||||
public void ToDomainEntity_WhenMappingMinimalBookRatingDto_ShouldMapRequiredPropertiesCorrectly()
|
||||
{
|
||||
// Arrange
|
||||
BookRatingDto dto = _bookRatingDtoFixture.Create(includeOptionalProperties: false);
|
||||
BookRatingDto dto = _bookRatingDtoFixture.Create(includeSource: false, includeVoteCount: false);
|
||||
|
||||
// Act
|
||||
Result<BookRating> result = dto.ToDomainEntity();
|
||||
@@ -90,7 +90,7 @@ public class BookRatingDtoMappingTests
|
||||
List<BookRatingDto> dtos =
|
||||
[
|
||||
_bookRatingDtoFixture.Create(),
|
||||
_bookRatingDtoFixture.Create(includeOptionalProperties: false)
|
||||
_bookRatingDtoFixture.Create(includeSource: false, includeVoteCount: false)
|
||||
];
|
||||
|
||||
// Act
|
||||
@@ -125,7 +125,7 @@ public class BookRatingDtoMappingTests
|
||||
[
|
||||
_bookRatingDtoFixture.Create(),
|
||||
_bookRatingDtoFixture.Create(value: 10, maxValue: 5),
|
||||
_bookRatingDtoFixture.Create(includeOptionalProperties: false)
|
||||
_bookRatingDtoFixture.Create(includeSource: false, includeVoteCount: false)
|
||||
];
|
||||
|
||||
// Act
|
||||
|
||||
+10
-10
@@ -419,7 +419,7 @@ public class AddTrackCommandValidatorTests
|
||||
public void Validate_WhenOriginalReleaseYearIsLessThan1_ShouldHaveValidationError()
|
||||
{
|
||||
// Arrange
|
||||
AddTrackCommand command = _addTrackCommandFixture.Create(metadata: _audioMetadataDtoFixture.Create(releaseInfo: new ReleaseInfoDto(null, 0, null, null, null, null)));
|
||||
AddTrackCommand command = _addTrackCommandFixture.Create(metadata: _audioMetadataDtoFixture.Create(releaseInfo: _releaseInfoDtoFixture.Create(originalReleaseYear: 0)));
|
||||
|
||||
// Act
|
||||
List<Error> result = _validator.TestValidate(command);
|
||||
@@ -432,7 +432,7 @@ public class AddTrackCommandValidatorTests
|
||||
public void Validate_WhenOriginalReleaseYearIsGreaterThan9999_ShouldHaveValidationError()
|
||||
{
|
||||
// Arrange
|
||||
AddTrackCommand command = _addTrackCommandFixture.Create(metadata: _audioMetadataDtoFixture.Create(releaseInfo: new ReleaseInfoDto(null, 10000, null, null, null, null)));
|
||||
AddTrackCommand command = _addTrackCommandFixture.Create(metadata: _audioMetadataDtoFixture.Create(releaseInfo: _releaseInfoDtoFixture.Create(originalReleaseYear: 10000)));
|
||||
|
||||
// Act
|
||||
List<Error> result = _validator.TestValidate(command);
|
||||
@@ -458,7 +458,7 @@ public class AddTrackCommandValidatorTests
|
||||
public void Validate_WhenReReleaseYearIsLessThan1_ShouldHaveValidationError()
|
||||
{
|
||||
// Arrange
|
||||
AddTrackCommand command = _addTrackCommandFixture.Create(metadata: _audioMetadataDtoFixture.Create(releaseInfo: new ReleaseInfoDto(null, null, null, 0, null, null)));
|
||||
AddTrackCommand command = _addTrackCommandFixture.Create(metadata: _audioMetadataDtoFixture.Create(releaseInfo: _releaseInfoDtoFixture.Create(reReleaseYear: 0)));
|
||||
|
||||
// Act
|
||||
List<Error> result = _validator.TestValidate(command);
|
||||
@@ -471,7 +471,7 @@ public class AddTrackCommandValidatorTests
|
||||
public void Validate_WhenReReleaseYearIsGreaterThan9999_ShouldHaveValidationError()
|
||||
{
|
||||
// Arrange
|
||||
AddTrackCommand command = _addTrackCommandFixture.Create(metadata: _audioMetadataDtoFixture.Create(releaseInfo: new ReleaseInfoDto(null, null, null, 10000, null, null)));
|
||||
AddTrackCommand command = _addTrackCommandFixture.Create(metadata: _audioMetadataDtoFixture.Create(releaseInfo: _releaseInfoDtoFixture.Create(reReleaseYear: 10000)));
|
||||
|
||||
// Act
|
||||
List<Error> result = _validator.TestValidate(command);
|
||||
@@ -943,7 +943,7 @@ public class AddTrackCommandValidatorTests
|
||||
public void Validate_WhenMusicBrainzRecordingIdIsNull_ShouldNotHaveValidationError()
|
||||
{
|
||||
// Arrange
|
||||
AddTrackCommand command = _addTrackCommandFixture.Create(includeOptionalProperties: false);
|
||||
AddTrackCommand command = _addTrackCommandFixture.Create(includeDiscNumber: false, includeScript: false, includeKey: false, includeBpm: false, includeWork: false, includeMusicBrainzRecordingId: false, includeMusicBrainzTrackId: false, includeMusicBrainzWorkId: false, includeMoods: false, includeIsrcs: false);
|
||||
|
||||
// Act
|
||||
List<Error> result = _validator.TestValidate(command);
|
||||
@@ -1054,7 +1054,7 @@ public class AddTrackCommandValidatorTests
|
||||
public void Validate_WhenDiscNumberIsNull_ShouldNotHaveValidationError()
|
||||
{
|
||||
// Arrange
|
||||
AddTrackCommand command = _addTrackCommandFixture.Create(includeOptionalProperties: false);
|
||||
AddTrackCommand command = _addTrackCommandFixture.Create(includeDiscNumber: false, includeScript: false, includeKey: false, includeBpm: false, includeWork: false, includeMusicBrainzRecordingId: false, includeMusicBrainzTrackId: false, includeMusicBrainzWorkId: false, includeMoods: false, includeIsrcs: false);
|
||||
|
||||
// Act
|
||||
List<Error> result = _validator.TestValidate(command);
|
||||
@@ -1093,7 +1093,7 @@ public class AddTrackCommandValidatorTests
|
||||
public void Validate_WhenScriptIsNull_ShouldNotHaveValidationError()
|
||||
{
|
||||
// Arrange
|
||||
AddTrackCommand command = _addTrackCommandFixture.Create(includeOptionalProperties: false);
|
||||
AddTrackCommand command = _addTrackCommandFixture.Create(includeDiscNumber: false, includeScript: false, includeKey: false, includeBpm: false, includeWork: false, includeMusicBrainzRecordingId: false, includeMusicBrainzTrackId: false, includeMusicBrainzWorkId: false, includeMoods: false, includeIsrcs: false);
|
||||
|
||||
// Act
|
||||
List<Error> result = _validator.TestValidate(command);
|
||||
@@ -1132,7 +1132,7 @@ public class AddTrackCommandValidatorTests
|
||||
public void Validate_WhenKeyIsNull_ShouldNotHaveValidationError()
|
||||
{
|
||||
// Arrange
|
||||
AddTrackCommand command = _addTrackCommandFixture.Create(includeOptionalProperties: false);
|
||||
AddTrackCommand command = _addTrackCommandFixture.Create(includeDiscNumber: false, includeScript: false, includeKey: false, includeBpm: false, includeWork: false, includeMusicBrainzRecordingId: false, includeMusicBrainzTrackId: false, includeMusicBrainzWorkId: false, includeMoods: false, includeIsrcs: false);
|
||||
|
||||
// Act
|
||||
List<Error> result = _validator.TestValidate(command);
|
||||
@@ -1173,7 +1173,7 @@ public class AddTrackCommandValidatorTests
|
||||
public void Validate_WhenBpmIsNull_ShouldNotHaveValidationError()
|
||||
{
|
||||
// Arrange
|
||||
AddTrackCommand command = _addTrackCommandFixture.Create(includeOptionalProperties: false);
|
||||
AddTrackCommand command = _addTrackCommandFixture.Create(includeDiscNumber: false, includeScript: false, includeKey: false, includeBpm: false, includeWork: false, includeMusicBrainzRecordingId: false, includeMusicBrainzTrackId: false, includeMusicBrainzWorkId: false, includeMoods: false, includeIsrcs: false);
|
||||
|
||||
// Act
|
||||
List<Error> result = _validator.TestValidate(command);
|
||||
@@ -1212,7 +1212,7 @@ public class AddTrackCommandValidatorTests
|
||||
public void Validate_WhenWorkIsNull_ShouldNotHaveValidationError()
|
||||
{
|
||||
// Arrange
|
||||
AddTrackCommand command = _addTrackCommandFixture.Create(includeOptionalProperties: false);
|
||||
AddTrackCommand command = _addTrackCommandFixture.Create(includeDiscNumber: false, includeScript: false, includeKey: false, includeBpm: false, includeWork: false, includeMusicBrainzRecordingId: false, includeMusicBrainzTrackId: false, includeMusicBrainzWorkId: false, includeMoods: false, includeIsrcs: false);
|
||||
|
||||
// Act
|
||||
List<Error> result = _validator.TestValidate(command);
|
||||
|
||||
+8
-8
@@ -1175,7 +1175,7 @@ public class UpdateTrackCommandValidatorTests
|
||||
public void Validate_WhenMusicBrainzRecordingIdIsNull_ShouldNotHaveValidationError()
|
||||
{
|
||||
// Arrange
|
||||
UpdateTrackCommand command = _updateTrackCommandFixture.Create(includeOptionalProperties: false);
|
||||
UpdateTrackCommand command = _updateTrackCommandFixture.Create(includeDiscNumber: false, includeScript: false, includeKey: false, includeBpm: false, includeWork: false, includeMusicBrainzRecordingId: false, includeMusicBrainzTrackId: false, includeMusicBrainzWorkId: false, includeMoods: false, includeIsrcs: false);
|
||||
|
||||
// Act
|
||||
List<Error> result = _validator.TestValidate(command);
|
||||
@@ -1214,7 +1214,7 @@ public class UpdateTrackCommandValidatorTests
|
||||
public void Validate_WhenMusicBrainzTrackIdIsNull_ShouldNotHaveValidationError()
|
||||
{
|
||||
// Arrange
|
||||
UpdateTrackCommand command = _updateTrackCommandFixture.Create(includeOptionalProperties: false);
|
||||
UpdateTrackCommand command = _updateTrackCommandFixture.Create(includeDiscNumber: false, includeScript: false, includeKey: false, includeBpm: false, includeWork: false, includeMusicBrainzRecordingId: false, includeMusicBrainzTrackId: false, includeMusicBrainzWorkId: false, includeMoods: false, includeIsrcs: false);
|
||||
|
||||
// Act
|
||||
List<Error> result = _validator.TestValidate(command);
|
||||
@@ -1253,7 +1253,7 @@ public class UpdateTrackCommandValidatorTests
|
||||
public void Validate_WhenMusicBrainzWorkIdIsNull_ShouldNotHaveValidationError()
|
||||
{
|
||||
// Arrange
|
||||
UpdateTrackCommand command = _updateTrackCommandFixture.Create(includeOptionalProperties: false);
|
||||
UpdateTrackCommand command = _updateTrackCommandFixture.Create(includeDiscNumber: false, includeScript: false, includeKey: false, includeBpm: false, includeWork: false, includeMusicBrainzRecordingId: false, includeMusicBrainzTrackId: false, includeMusicBrainzWorkId: false, includeMoods: false, includeIsrcs: false);
|
||||
|
||||
// Act
|
||||
List<Error> result = _validator.TestValidate(command);
|
||||
@@ -1357,7 +1357,7 @@ public class UpdateTrackCommandValidatorTests
|
||||
public void Validate_WhenDiscNumberIsNull_ShouldNotHaveValidationError()
|
||||
{
|
||||
// Arrange
|
||||
UpdateTrackCommand command = _updateTrackCommandFixture.Create(includeOptionalProperties: false);
|
||||
UpdateTrackCommand command = _updateTrackCommandFixture.Create(includeDiscNumber: false, includeScript: false, includeKey: false, includeBpm: false, includeWork: false, includeMusicBrainzRecordingId: false, includeMusicBrainzTrackId: false, includeMusicBrainzWorkId: false, includeMoods: false, includeIsrcs: false);
|
||||
|
||||
// Act
|
||||
List<Error> result = _validator.TestValidate(command);
|
||||
@@ -1396,7 +1396,7 @@ public class UpdateTrackCommandValidatorTests
|
||||
public void Validate_WhenScriptIsNull_ShouldNotHaveValidationError()
|
||||
{
|
||||
// Arrange
|
||||
UpdateTrackCommand command = _updateTrackCommandFixture.Create(includeOptionalProperties: false);
|
||||
UpdateTrackCommand command = _updateTrackCommandFixture.Create(includeDiscNumber: false, includeScript: false, includeKey: false, includeBpm: false, includeWork: false, includeMusicBrainzRecordingId: false, includeMusicBrainzTrackId: false, includeMusicBrainzWorkId: false, includeMoods: false, includeIsrcs: false);
|
||||
|
||||
// Act
|
||||
List<Error> result = _validator.TestValidate(command);
|
||||
@@ -1435,7 +1435,7 @@ public class UpdateTrackCommandValidatorTests
|
||||
public void Validate_WhenKeyIsNull_ShouldNotHaveValidationError()
|
||||
{
|
||||
// Arrange
|
||||
UpdateTrackCommand command = _updateTrackCommandFixture.Create(includeOptionalProperties: false);
|
||||
UpdateTrackCommand command = _updateTrackCommandFixture.Create(includeDiscNumber: false, includeScript: false, includeKey: false, includeBpm: false, includeWork: false, includeMusicBrainzRecordingId: false, includeMusicBrainzTrackId: false, includeMusicBrainzWorkId: false, includeMoods: false, includeIsrcs: false);
|
||||
|
||||
// Act
|
||||
List<Error> result = _validator.TestValidate(command);
|
||||
@@ -1487,7 +1487,7 @@ public class UpdateTrackCommandValidatorTests
|
||||
public void Validate_WhenBpmIsNull_ShouldNotHaveValidationError()
|
||||
{
|
||||
// Arrange
|
||||
UpdateTrackCommand command = _updateTrackCommandFixture.Create(includeOptionalProperties: false);
|
||||
UpdateTrackCommand command = _updateTrackCommandFixture.Create(includeDiscNumber: false, includeScript: false, includeKey: false, includeBpm: false, includeWork: false, includeMusicBrainzRecordingId: false, includeMusicBrainzTrackId: false, includeMusicBrainzWorkId: false, includeMoods: false, includeIsrcs: false);
|
||||
|
||||
// Act
|
||||
List<Error> result = _validator.TestValidate(command);
|
||||
@@ -1526,7 +1526,7 @@ public class UpdateTrackCommandValidatorTests
|
||||
public void Validate_WhenWorkIsNull_ShouldNotHaveValidationError()
|
||||
{
|
||||
// Arrange
|
||||
UpdateTrackCommand command = _updateTrackCommandFixture.Create(includeOptionalProperties: false);
|
||||
UpdateTrackCommand command = _updateTrackCommandFixture.Create(includeDiscNumber: false, includeScript: false, includeKey: false, includeBpm: false, includeWork: false, includeMusicBrainzRecordingId: false, includeMusicBrainzTrackId: false, includeMusicBrainzWorkId: false, includeMoods: false, includeIsrcs: false);
|
||||
|
||||
// Act
|
||||
List<Error> result = _validator.TestValidate(command);
|
||||
|
||||
+1
-1
@@ -226,7 +226,7 @@ public class AddBookCommandHandlerTests
|
||||
public async Task HandleAsync_WhenCalledWithInvalidRating_ShouldReturnFailureResult()
|
||||
{
|
||||
// Arrange
|
||||
AddBookCommand bookCommand = _commandBookFixture.Create(ratings: [_bookRatingDtoFixture.Create(value: -1, maxValue: 5, includeOptionalProperties: false)]);
|
||||
AddBookCommand bookCommand = _commandBookFixture.Create(ratings: [_bookRatingDtoFixture.Create(value: -1, maxValue: 5, includeSource: false, includeVoteCount: false)]);
|
||||
|
||||
// Act
|
||||
Result<BookResponse> result = await _sut.HandleAsync(bookCommand, CancellationToken.None);
|
||||
|
||||
+19
-19
@@ -210,7 +210,7 @@ public class AddBookCommandValidatorTests
|
||||
public void Validate_WhenOriginalReleaseYearIsLessThan1_ShouldHaveValidationError()
|
||||
{
|
||||
// Arrange
|
||||
AddBookCommand bookCommand = _commandBookFixture.Create(metadata: _writtenContentMetadataDtoFixture.Create(releaseInfo: new ReleaseInfoDto(null, 0, null, null, null, null)));
|
||||
AddBookCommand bookCommand = _commandBookFixture.Create(metadata: _writtenContentMetadataDtoFixture.Create(releaseInfo: _releaseInfoDtoFixture.Create(originalReleaseYear: 0)));
|
||||
|
||||
// Act
|
||||
List<Error> result = _validator.TestValidate(bookCommand);
|
||||
@@ -223,7 +223,7 @@ public class AddBookCommandValidatorTests
|
||||
public void Validate_WhenOriginalReleaseYearIsGreaterThan9999_ShouldHaveValidationError()
|
||||
{
|
||||
// Arrange
|
||||
AddBookCommand bookCommand = _commandBookFixture.Create(metadata: _writtenContentMetadataDtoFixture.Create(releaseInfo: new ReleaseInfoDto(null, 10000, null, null, null, null)));
|
||||
AddBookCommand bookCommand = _commandBookFixture.Create(metadata: _writtenContentMetadataDtoFixture.Create(releaseInfo: _releaseInfoDtoFixture.Create(originalReleaseYear: 10000)));
|
||||
|
||||
// Act
|
||||
List<Error> result = _validator.TestValidate(bookCommand);
|
||||
@@ -249,7 +249,7 @@ public class AddBookCommandValidatorTests
|
||||
public void Validate_WhenReReleaseYearIsLessThan1_ShouldHaveValidationError()
|
||||
{
|
||||
// Arrange
|
||||
AddBookCommand bookCommand = _commandBookFixture.Create(metadata: _writtenContentMetadataDtoFixture.Create(releaseInfo: new ReleaseInfoDto(null, null, null, 0, null, null)));
|
||||
AddBookCommand bookCommand = _commandBookFixture.Create(metadata: _writtenContentMetadataDtoFixture.Create(releaseInfo: _releaseInfoDtoFixture.Create(reReleaseYear: 0)));
|
||||
|
||||
// Act
|
||||
List<Error> result = _validator.TestValidate(bookCommand);
|
||||
@@ -262,7 +262,7 @@ public class AddBookCommandValidatorTests
|
||||
public void Validate_WhenReReleaseYearIsGreaterThan9999_ShouldHaveValidationError()
|
||||
{
|
||||
// Arrange
|
||||
AddBookCommand bookCommand = _commandBookFixture.Create(metadata: _writtenContentMetadataDtoFixture.Create(releaseInfo: new ReleaseInfoDto(null, null, null, 10000, null, null)));
|
||||
AddBookCommand bookCommand = _commandBookFixture.Create(metadata: _writtenContentMetadataDtoFixture.Create(releaseInfo: _releaseInfoDtoFixture.Create(reReleaseYear: 10000)));
|
||||
|
||||
// Act
|
||||
List<Error> result = _validator.TestValidate(bookCommand);
|
||||
@@ -756,7 +756,7 @@ public class AddBookCommandValidatorTests
|
||||
public void Validate_WhenFormatIsNull_ShouldNotHaveValidationError()
|
||||
{
|
||||
// Arrange
|
||||
AddBookCommand bookCommand = _commandBookFixture.Create(includeOptionalProperties: false);
|
||||
AddBookCommand bookCommand = _commandBookFixture.Create(includeFormat: false, includeEdition: false, includeVolumeNumber: false, includeAsin: false, includeGoodreadsId: false, includeLccn: false, includeOclcNumber: false, includeOpenLibraryId: false, includeLibraryThingId: false, includeGoogleBooksId: false, includeBarnesAndNobleId: false, includeAppleBooksId: false, includeIsbns: false, includeRatings: false, includeContributors: false);
|
||||
|
||||
// Act
|
||||
List<Error> result = _validator.TestValidate(bookCommand);
|
||||
@@ -795,7 +795,7 @@ public class AddBookCommandValidatorTests
|
||||
public void Validate_WhenEditionIsNull_ShouldNotHaveValidationError()
|
||||
{
|
||||
// Arrange
|
||||
AddBookCommand bookCommand = _commandBookFixture.Create(includeOptionalProperties: false);
|
||||
AddBookCommand bookCommand = _commandBookFixture.Create(includeFormat: false, includeEdition: false, includeVolumeNumber: false, includeAsin: false, includeGoodreadsId: false, includeLccn: false, includeOclcNumber: false, includeOpenLibraryId: false, includeLibraryThingId: false, includeGoogleBooksId: false, includeBarnesAndNobleId: false, includeAppleBooksId: false, includeIsbns: false, includeRatings: false, includeContributors: false);
|
||||
|
||||
// Act
|
||||
List<Error> result = _validator.TestValidate(bookCommand);
|
||||
@@ -834,7 +834,7 @@ public class AddBookCommandValidatorTests
|
||||
public void Validate_WhenVolumeNumberIsNull_ShouldNotHaveValidationError()
|
||||
{
|
||||
// Arrange
|
||||
AddBookCommand bookCommand = _commandBookFixture.Create(includeOptionalProperties: false);
|
||||
AddBookCommand bookCommand = _commandBookFixture.Create(includeFormat: false, includeEdition: false, includeVolumeNumber: false, includeAsin: false, includeGoodreadsId: false, includeLccn: false, includeOclcNumber: false, includeOpenLibraryId: false, includeLibraryThingId: false, includeGoogleBooksId: false, includeBarnesAndNobleId: false, includeAppleBooksId: false, includeIsbns: false, includeRatings: false, includeContributors: false);
|
||||
|
||||
// Act
|
||||
List<Error> result = _validator.TestValidate(bookCommand);
|
||||
@@ -954,7 +954,7 @@ public class AddBookCommandValidatorTests
|
||||
public void Validate_WhenAsinIsNull_ShouldNotHaveValidationError()
|
||||
{
|
||||
// Arrange
|
||||
AddBookCommand bookCommand = _commandBookFixture.Create(includeOptionalProperties: false);
|
||||
AddBookCommand bookCommand = _commandBookFixture.Create(includeFormat: false, includeEdition: false, includeVolumeNumber: false, includeAsin: false, includeGoodreadsId: false, includeLccn: false, includeOclcNumber: false, includeOpenLibraryId: false, includeLibraryThingId: false, includeGoogleBooksId: false, includeBarnesAndNobleId: false, includeAppleBooksId: false, includeIsbns: false, includeRatings: false, includeContributors: false);
|
||||
|
||||
// Act
|
||||
List<Error> result = _validator.TestValidate(bookCommand);
|
||||
@@ -980,7 +980,7 @@ public class AddBookCommandValidatorTests
|
||||
public void Validate_WhenGoodreadsIdIsNull_ShouldNotHaveValidationError()
|
||||
{
|
||||
// Arrange
|
||||
AddBookCommand bookCommand = _commandBookFixture.Create(includeOptionalProperties: false);
|
||||
AddBookCommand bookCommand = _commandBookFixture.Create(includeFormat: false, includeEdition: false, includeVolumeNumber: false, includeAsin: false, includeGoodreadsId: false, includeLccn: false, includeOclcNumber: false, includeOpenLibraryId: false, includeLibraryThingId: false, includeGoogleBooksId: false, includeBarnesAndNobleId: false, includeAppleBooksId: false, includeIsbns: false, includeRatings: false, includeContributors: false);
|
||||
|
||||
// Act
|
||||
List<Error> result = _validator.TestValidate(bookCommand);
|
||||
@@ -1045,7 +1045,7 @@ public class AddBookCommandValidatorTests
|
||||
public void Validate_WhenLccnIsNull_ShouldNotHaveValidationError()
|
||||
{
|
||||
// Arrange
|
||||
AddBookCommand bookCommand = _commandBookFixture.Create(includeOptionalProperties: false);
|
||||
AddBookCommand bookCommand = _commandBookFixture.Create(includeFormat: false, includeEdition: false, includeVolumeNumber: false, includeAsin: false, includeGoodreadsId: false, includeLccn: false, includeOclcNumber: false, includeOpenLibraryId: false, includeLibraryThingId: false, includeGoogleBooksId: false, includeBarnesAndNobleId: false, includeAppleBooksId: false, includeIsbns: false, includeRatings: false, includeContributors: false);
|
||||
|
||||
// Act
|
||||
List<Error> result = _validator.TestValidate(bookCommand);
|
||||
@@ -1110,7 +1110,7 @@ public class AddBookCommandValidatorTests
|
||||
public void Validate_WhenCalledWithEmptyOclcNumber_ShouldNotHaveValidationError()
|
||||
{
|
||||
// Arrange
|
||||
AddBookCommand bookCommand = _commandBookFixture.Create(includeOptionalProperties: false);
|
||||
AddBookCommand bookCommand = _commandBookFixture.Create(includeFormat: false, includeEdition: false, includeVolumeNumber: false, includeAsin: false, includeGoodreadsId: false, includeLccn: false, includeOclcNumber: false, includeOpenLibraryId: false, includeLibraryThingId: false, includeGoogleBooksId: false, includeBarnesAndNobleId: false, includeAppleBooksId: false, includeIsbns: false, includeRatings: false, includeContributors: false);
|
||||
|
||||
// Act
|
||||
List<Error> result = _validator.TestValidate(bookCommand);
|
||||
@@ -1201,7 +1201,7 @@ public class AddBookCommandValidatorTests
|
||||
public void Validate_WhenOpenLibraryIdIsNull_ShouldNotHaveValidationError()
|
||||
{
|
||||
// Arrange
|
||||
AddBookCommand bookCommand = _commandBookFixture.Create(includeOptionalProperties: false);
|
||||
AddBookCommand bookCommand = _commandBookFixture.Create(includeFormat: false, includeEdition: false, includeVolumeNumber: false, includeAsin: false, includeGoodreadsId: false, includeLccn: false, includeOclcNumber: false, includeOpenLibraryId: false, includeLibraryThingId: false, includeGoogleBooksId: false, includeBarnesAndNobleId: false, includeAppleBooksId: false, includeIsbns: false, includeRatings: false, includeContributors: false);
|
||||
|
||||
// Act
|
||||
List<Error> result = _validator.TestValidate(bookCommand);
|
||||
@@ -1266,7 +1266,7 @@ public class AddBookCommandValidatorTests
|
||||
public void Validate_WhenCalledWithEmptyLibraryThingId_ShouldNotHaveValidationError()
|
||||
{
|
||||
// Arrange
|
||||
AddBookCommand bookCommand = _commandBookFixture.Create(includeOptionalProperties: false);
|
||||
AddBookCommand bookCommand = _commandBookFixture.Create(includeFormat: false, includeEdition: false, includeVolumeNumber: false, includeAsin: false, includeGoodreadsId: false, includeLccn: false, includeOclcNumber: false, includeOpenLibraryId: false, includeLibraryThingId: false, includeGoogleBooksId: false, includeBarnesAndNobleId: false, includeAppleBooksId: false, includeIsbns: false, includeRatings: false, includeContributors: false);
|
||||
|
||||
// Act
|
||||
List<Error> result = _validator.TestValidate(bookCommand);
|
||||
@@ -1305,7 +1305,7 @@ public class AddBookCommandValidatorTests
|
||||
public void Validate_WhenCalledWithEmptyGoogleBooksId_ShouldNotHaveValidationError()
|
||||
{
|
||||
// Arrange
|
||||
AddBookCommand bookCommand = _commandBookFixture.Create(includeOptionalProperties: false);
|
||||
AddBookCommand bookCommand = _commandBookFixture.Create(includeFormat: false, includeEdition: false, includeVolumeNumber: false, includeAsin: false, includeGoodreadsId: false, includeLccn: false, includeOclcNumber: false, includeOpenLibraryId: false, includeLibraryThingId: false, includeGoogleBooksId: false, includeBarnesAndNobleId: false, includeAppleBooksId: false, includeIsbns: false, includeRatings: false, includeContributors: false);
|
||||
|
||||
// Act
|
||||
List<Error> result = _validator.TestValidate(bookCommand);
|
||||
@@ -1357,7 +1357,7 @@ public class AddBookCommandValidatorTests
|
||||
public void Validate_WhenCalledWithEmptyBarnesAndNobleId_ShouldNotHaveValidationError()
|
||||
{
|
||||
// Arrange
|
||||
AddBookCommand bookCommand = _commandBookFixture.Create(includeOptionalProperties: false);
|
||||
AddBookCommand bookCommand = _commandBookFixture.Create(includeFormat: false, includeEdition: false, includeVolumeNumber: false, includeAsin: false, includeGoodreadsId: false, includeLccn: false, includeOclcNumber: false, includeOpenLibraryId: false, includeLibraryThingId: false, includeGoogleBooksId: false, includeBarnesAndNobleId: false, includeAppleBooksId: false, includeIsbns: false, includeRatings: false, includeContributors: false);
|
||||
|
||||
// Act
|
||||
List<Error> result = _validator.TestValidate(bookCommand);
|
||||
@@ -1409,7 +1409,7 @@ public class AddBookCommandValidatorTests
|
||||
public void Validate_WhenCalledWithEmptyAppleBooksId_ShouldNotHaveValidationError()
|
||||
{
|
||||
// Arrange
|
||||
AddBookCommand bookCommand = _commandBookFixture.Create(includeOptionalProperties: false);
|
||||
AddBookCommand bookCommand = _commandBookFixture.Create(includeFormat: false, includeEdition: false, includeVolumeNumber: false, includeAsin: false, includeGoodreadsId: false, includeLccn: false, includeOclcNumber: false, includeOpenLibraryId: false, includeLibraryThingId: false, includeGoogleBooksId: false, includeBarnesAndNobleId: false, includeAppleBooksId: false, includeIsbns: false, includeRatings: false, includeContributors: false);
|
||||
|
||||
// Act
|
||||
List<Error> result = _validator.TestValidate(bookCommand);
|
||||
@@ -1448,7 +1448,7 @@ public class AddBookCommandValidatorTests
|
||||
public void Validate_WhenCalledWithNullIsbns_ShouldHaveValidationError()
|
||||
{
|
||||
// Arrange
|
||||
AddBookCommand bookCommand = _commandBookFixture.Create(includeOptionalProperties: false);
|
||||
AddBookCommand bookCommand = _commandBookFixture.Create(includeFormat: false, includeEdition: false, includeVolumeNumber: false, includeAsin: false, includeGoodreadsId: false, includeLccn: false, includeOclcNumber: false, includeOpenLibraryId: false, includeLibraryThingId: false, includeGoogleBooksId: false, includeBarnesAndNobleId: false, includeAppleBooksId: false, includeIsbns: false, includeRatings: false, includeContributors: false);
|
||||
|
||||
// Act
|
||||
List<Error> result = _validator.TestValidate(bookCommand);
|
||||
@@ -1591,7 +1591,7 @@ public class AddBookCommandValidatorTests
|
||||
public void Validate_WhenCalledWithNullRatings_ShouldHaveValidationError()
|
||||
{
|
||||
// Arrange
|
||||
AddBookCommand bookCommand = _commandBookFixture.Create(includeOptionalProperties: false);
|
||||
AddBookCommand bookCommand = _commandBookFixture.Create(includeFormat: false, includeEdition: false, includeVolumeNumber: false, includeAsin: false, includeGoodreadsId: false, includeLccn: false, includeOclcNumber: false, includeOpenLibraryId: false, includeLibraryThingId: false, includeGoogleBooksId: false, includeBarnesAndNobleId: false, includeAppleBooksId: false, includeIsbns: false, includeRatings: false, includeContributors: false);
|
||||
|
||||
// Act
|
||||
List<Error> result = _validator.TestValidate(bookCommand);
|
||||
@@ -1669,7 +1669,7 @@ public class AddBookCommandValidatorTests
|
||||
public void Validate_WhenCalledWithNullVoteCount_ShouldNotHaveValidationError()
|
||||
{
|
||||
// Arrange
|
||||
AddBookCommand bookCommand = _commandBookFixture.Create(ratings: [_bookRatingDtoFixture.Create(includeOptionalProperties: false)]);
|
||||
AddBookCommand bookCommand = _commandBookFixture.Create(ratings: [_bookRatingDtoFixture.Create(includeSource: false, includeVoteCount: false)]);
|
||||
|
||||
// Act
|
||||
List<Error> result = _validator.TestValidate(bookCommand);
|
||||
|
||||
+1
-1
@@ -343,7 +343,7 @@ public class UpdateBookCommandHandlerTests
|
||||
public async Task HandleAsync_WhenCalledWithInvalidRating_ShouldReturnFailureResult()
|
||||
{
|
||||
// Arrange
|
||||
UpdateBookCommand command = _commandBookFixture.Create(ratings: [_bookRatingDtoFixture.Create(value: -1, maxValue: 5, includeOptionalProperties: false)]);
|
||||
UpdateBookCommand command = _commandBookFixture.Create(ratings: [_bookRatingDtoFixture.Create(value: -1, maxValue: 5, includeSource: false, includeVoteCount: false)]);
|
||||
BookEntity existingBook = _bookEntityFixture.Create(id: Guid.Parse(command.BookId!), libraryId: Guid.Parse(command.LibraryId!));
|
||||
_mockBookRepository.GetByIdAsync(Arg.Any<Guid>(), Arg.Any<bool>(), Arg.Any<bool>(), Arg.Any<CancellationToken>())
|
||||
.Returns(Result.From<BookEntity?>(existingBook));
|
||||
|
||||
+19
-19
@@ -197,7 +197,7 @@ public class UpdateBookCommandValidatorTests
|
||||
public void Validate_WhenOriginalReleaseYearIsLessThan1_ShouldHaveValidationError()
|
||||
{
|
||||
// Arrange
|
||||
UpdateBookCommand bookCommand = _commandBookFixture.Create(metadata: _writtenContentMetadataDtoFixture.Create(releaseInfo: new ReleaseInfoDto(null, 0, null, null, null, null)));
|
||||
UpdateBookCommand bookCommand = _commandBookFixture.Create(metadata: _writtenContentMetadataDtoFixture.Create(releaseInfo: _releaseInfoDtoFixture.Create(originalReleaseYear: 0)));
|
||||
|
||||
// Act
|
||||
List<Error> result = _validator.TestValidate(bookCommand);
|
||||
@@ -210,7 +210,7 @@ public class UpdateBookCommandValidatorTests
|
||||
public void Validate_WhenOriginalReleaseYearIsGreaterThan9999_ShouldHaveValidationError()
|
||||
{
|
||||
// Arrange
|
||||
UpdateBookCommand bookCommand = _commandBookFixture.Create(metadata: _writtenContentMetadataDtoFixture.Create(releaseInfo: new ReleaseInfoDto(null, 10000, null, null, null, null)));
|
||||
UpdateBookCommand bookCommand = _commandBookFixture.Create(metadata: _writtenContentMetadataDtoFixture.Create(releaseInfo: _releaseInfoDtoFixture.Create(originalReleaseYear: 10000)));
|
||||
|
||||
// Act
|
||||
List<Error> result = _validator.TestValidate(bookCommand);
|
||||
@@ -236,7 +236,7 @@ public class UpdateBookCommandValidatorTests
|
||||
public void Validate_WhenReReleaseYearIsLessThan1_ShouldHaveValidationError()
|
||||
{
|
||||
// Arrange
|
||||
UpdateBookCommand bookCommand = _commandBookFixture.Create(metadata: _writtenContentMetadataDtoFixture.Create(releaseInfo: new ReleaseInfoDto(null, null, null, 0, null, null)));
|
||||
UpdateBookCommand bookCommand = _commandBookFixture.Create(metadata: _writtenContentMetadataDtoFixture.Create(releaseInfo: _releaseInfoDtoFixture.Create(reReleaseYear: 0)));
|
||||
|
||||
// Act
|
||||
List<Error> result = _validator.TestValidate(bookCommand);
|
||||
@@ -249,7 +249,7 @@ public class UpdateBookCommandValidatorTests
|
||||
public void Validate_WhenReReleaseYearIsGreaterThan9999_ShouldHaveValidationError()
|
||||
{
|
||||
// Arrange
|
||||
UpdateBookCommand bookCommand = _commandBookFixture.Create(metadata: _writtenContentMetadataDtoFixture.Create(releaseInfo: new ReleaseInfoDto(null, null, null, 10000, null, null)));
|
||||
UpdateBookCommand bookCommand = _commandBookFixture.Create(metadata: _writtenContentMetadataDtoFixture.Create(releaseInfo: _releaseInfoDtoFixture.Create(reReleaseYear: 10000)));
|
||||
|
||||
// Act
|
||||
List<Error> result = _validator.TestValidate(bookCommand);
|
||||
@@ -743,7 +743,7 @@ public class UpdateBookCommandValidatorTests
|
||||
public void Validate_WhenFormatIsNull_ShouldNotHaveValidationError()
|
||||
{
|
||||
// Arrange
|
||||
UpdateBookCommand bookCommand = _commandBookFixture.Create(includeOptionalProperties: false);
|
||||
UpdateBookCommand bookCommand = _commandBookFixture.Create(includeFormat: false, includeEdition: false, includeVolumeNumber: false, includeAsin: false, includeGoodreadsId: false, includeLccn: false, includeOclcNumber: false, includeOpenLibraryId: false, includeLibraryThingId: false, includeGoogleBooksId: false, includeBarnesAndNobleId: false, includeAppleBooksId: false, includeIsbns: false, includeRatings: false, includeContributors: false);
|
||||
|
||||
// Act
|
||||
List<Error> result = _validator.TestValidate(bookCommand);
|
||||
@@ -782,7 +782,7 @@ public class UpdateBookCommandValidatorTests
|
||||
public void Validate_WhenEditionIsNull_ShouldNotHaveValidationError()
|
||||
{
|
||||
// Arrange
|
||||
UpdateBookCommand bookCommand = _commandBookFixture.Create(includeOptionalProperties: false);
|
||||
UpdateBookCommand bookCommand = _commandBookFixture.Create(includeFormat: false, includeEdition: false, includeVolumeNumber: false, includeAsin: false, includeGoodreadsId: false, includeLccn: false, includeOclcNumber: false, includeOpenLibraryId: false, includeLibraryThingId: false, includeGoogleBooksId: false, includeBarnesAndNobleId: false, includeAppleBooksId: false, includeIsbns: false, includeRatings: false, includeContributors: false);
|
||||
|
||||
// Act
|
||||
List<Error> result = _validator.TestValidate(bookCommand);
|
||||
@@ -821,7 +821,7 @@ public class UpdateBookCommandValidatorTests
|
||||
public void Validate_WhenVolumeNumberIsNull_ShouldNotHaveValidationError()
|
||||
{
|
||||
// Arrange
|
||||
UpdateBookCommand bookCommand = _commandBookFixture.Create(includeOptionalProperties: false);
|
||||
UpdateBookCommand bookCommand = _commandBookFixture.Create(includeFormat: false, includeEdition: false, includeVolumeNumber: false, includeAsin: false, includeGoodreadsId: false, includeLccn: false, includeOclcNumber: false, includeOpenLibraryId: false, includeLibraryThingId: false, includeGoogleBooksId: false, includeBarnesAndNobleId: false, includeAppleBooksId: false, includeIsbns: false, includeRatings: false, includeContributors: false);
|
||||
|
||||
// Act
|
||||
List<Error> result = _validator.TestValidate(bookCommand);
|
||||
@@ -941,7 +941,7 @@ public class UpdateBookCommandValidatorTests
|
||||
public void Validate_WhenAsinIsNull_ShouldNotHaveValidationError()
|
||||
{
|
||||
// Arrange
|
||||
UpdateBookCommand bookCommand = _commandBookFixture.Create(includeOptionalProperties: false);
|
||||
UpdateBookCommand bookCommand = _commandBookFixture.Create(includeFormat: false, includeEdition: false, includeVolumeNumber: false, includeAsin: false, includeGoodreadsId: false, includeLccn: false, includeOclcNumber: false, includeOpenLibraryId: false, includeLibraryThingId: false, includeGoogleBooksId: false, includeBarnesAndNobleId: false, includeAppleBooksId: false, includeIsbns: false, includeRatings: false, includeContributors: false);
|
||||
|
||||
// Act
|
||||
List<Error> result = _validator.TestValidate(bookCommand);
|
||||
@@ -967,7 +967,7 @@ public class UpdateBookCommandValidatorTests
|
||||
public void Validate_WhenGoodreadsIdIsNull_ShouldNotHaveValidationError()
|
||||
{
|
||||
// Arrange
|
||||
UpdateBookCommand bookCommand = _commandBookFixture.Create(includeOptionalProperties: false);
|
||||
UpdateBookCommand bookCommand = _commandBookFixture.Create(includeFormat: false, includeEdition: false, includeVolumeNumber: false, includeAsin: false, includeGoodreadsId: false, includeLccn: false, includeOclcNumber: false, includeOpenLibraryId: false, includeLibraryThingId: false, includeGoogleBooksId: false, includeBarnesAndNobleId: false, includeAppleBooksId: false, includeIsbns: false, includeRatings: false, includeContributors: false);
|
||||
|
||||
// Act
|
||||
List<Error> result = _validator.TestValidate(bookCommand);
|
||||
@@ -1032,7 +1032,7 @@ public class UpdateBookCommandValidatorTests
|
||||
public void Validate_WhenLccnIsNull_ShouldNotHaveValidationError()
|
||||
{
|
||||
// Arrange
|
||||
UpdateBookCommand bookCommand = _commandBookFixture.Create(includeOptionalProperties: false);
|
||||
UpdateBookCommand bookCommand = _commandBookFixture.Create(includeFormat: false, includeEdition: false, includeVolumeNumber: false, includeAsin: false, includeGoodreadsId: false, includeLccn: false, includeOclcNumber: false, includeOpenLibraryId: false, includeLibraryThingId: false, includeGoogleBooksId: false, includeBarnesAndNobleId: false, includeAppleBooksId: false, includeIsbns: false, includeRatings: false, includeContributors: false);
|
||||
|
||||
// Act
|
||||
List<Error> result = _validator.TestValidate(bookCommand);
|
||||
@@ -1097,7 +1097,7 @@ public class UpdateBookCommandValidatorTests
|
||||
public void Validate_WhenCalledWithEmptyOclcNumber_ShouldNotHaveValidationError()
|
||||
{
|
||||
// Arrange
|
||||
UpdateBookCommand bookCommand = _commandBookFixture.Create(includeOptionalProperties: false);
|
||||
UpdateBookCommand bookCommand = _commandBookFixture.Create(includeFormat: false, includeEdition: false, includeVolumeNumber: false, includeAsin: false, includeGoodreadsId: false, includeLccn: false, includeOclcNumber: false, includeOpenLibraryId: false, includeLibraryThingId: false, includeGoogleBooksId: false, includeBarnesAndNobleId: false, includeAppleBooksId: false, includeIsbns: false, includeRatings: false, includeContributors: false);
|
||||
|
||||
// Act
|
||||
List<Error> result = _validator.TestValidate(bookCommand);
|
||||
@@ -1188,7 +1188,7 @@ public class UpdateBookCommandValidatorTests
|
||||
public void Validate_WhenOpenLibraryIdIsNull_ShouldNotHaveValidationError()
|
||||
{
|
||||
// Arrange
|
||||
UpdateBookCommand bookCommand = _commandBookFixture.Create(includeOptionalProperties: false);
|
||||
UpdateBookCommand bookCommand = _commandBookFixture.Create(includeFormat: false, includeEdition: false, includeVolumeNumber: false, includeAsin: false, includeGoodreadsId: false, includeLccn: false, includeOclcNumber: false, includeOpenLibraryId: false, includeLibraryThingId: false, includeGoogleBooksId: false, includeBarnesAndNobleId: false, includeAppleBooksId: false, includeIsbns: false, includeRatings: false, includeContributors: false);
|
||||
|
||||
// Act
|
||||
List<Error> result = _validator.TestValidate(bookCommand);
|
||||
@@ -1253,7 +1253,7 @@ public class UpdateBookCommandValidatorTests
|
||||
public void Validate_WhenCalledWithEmptyLibraryThingId_ShouldNotHaveValidationError()
|
||||
{
|
||||
// Arrange
|
||||
UpdateBookCommand bookCommand = _commandBookFixture.Create(includeOptionalProperties: false);
|
||||
UpdateBookCommand bookCommand = _commandBookFixture.Create(includeFormat: false, includeEdition: false, includeVolumeNumber: false, includeAsin: false, includeGoodreadsId: false, includeLccn: false, includeOclcNumber: false, includeOpenLibraryId: false, includeLibraryThingId: false, includeGoogleBooksId: false, includeBarnesAndNobleId: false, includeAppleBooksId: false, includeIsbns: false, includeRatings: false, includeContributors: false);
|
||||
|
||||
// Act
|
||||
List<Error> result = _validator.TestValidate(bookCommand);
|
||||
@@ -1292,7 +1292,7 @@ public class UpdateBookCommandValidatorTests
|
||||
public void Validate_WhenCalledWithEmptyGoogleBooksId_ShouldNotHaveValidationError()
|
||||
{
|
||||
// Arrange
|
||||
UpdateBookCommand bookCommand = _commandBookFixture.Create(includeOptionalProperties: false);
|
||||
UpdateBookCommand bookCommand = _commandBookFixture.Create(includeFormat: false, includeEdition: false, includeVolumeNumber: false, includeAsin: false, includeGoodreadsId: false, includeLccn: false, includeOclcNumber: false, includeOpenLibraryId: false, includeLibraryThingId: false, includeGoogleBooksId: false, includeBarnesAndNobleId: false, includeAppleBooksId: false, includeIsbns: false, includeRatings: false, includeContributors: false);
|
||||
|
||||
// Act
|
||||
List<Error> result = _validator.TestValidate(bookCommand);
|
||||
@@ -1344,7 +1344,7 @@ public class UpdateBookCommandValidatorTests
|
||||
public void Validate_WhenCalledWithEmptyBarnesAndNobleId_ShouldNotHaveValidationError()
|
||||
{
|
||||
// Arrange
|
||||
UpdateBookCommand bookCommand = _commandBookFixture.Create(includeOptionalProperties: false);
|
||||
UpdateBookCommand bookCommand = _commandBookFixture.Create(includeFormat: false, includeEdition: false, includeVolumeNumber: false, includeAsin: false, includeGoodreadsId: false, includeLccn: false, includeOclcNumber: false, includeOpenLibraryId: false, includeLibraryThingId: false, includeGoogleBooksId: false, includeBarnesAndNobleId: false, includeAppleBooksId: false, includeIsbns: false, includeRatings: false, includeContributors: false);
|
||||
|
||||
// Act
|
||||
List<Error> result = _validator.TestValidate(bookCommand);
|
||||
@@ -1396,7 +1396,7 @@ public class UpdateBookCommandValidatorTests
|
||||
public void Validate_WhenCalledWithEmptyAppleBooksId_ShouldNotHaveValidationError()
|
||||
{
|
||||
// Arrange
|
||||
UpdateBookCommand bookCommand = _commandBookFixture.Create(includeOptionalProperties: false);
|
||||
UpdateBookCommand bookCommand = _commandBookFixture.Create(includeFormat: false, includeEdition: false, includeVolumeNumber: false, includeAsin: false, includeGoodreadsId: false, includeLccn: false, includeOclcNumber: false, includeOpenLibraryId: false, includeLibraryThingId: false, includeGoogleBooksId: false, includeBarnesAndNobleId: false, includeAppleBooksId: false, includeIsbns: false, includeRatings: false, includeContributors: false);
|
||||
|
||||
// Act
|
||||
List<Error> result = _validator.TestValidate(bookCommand);
|
||||
@@ -1435,7 +1435,7 @@ public class UpdateBookCommandValidatorTests
|
||||
public void Validate_WhenCalledWithNullIsbns_ShouldHaveValidationError()
|
||||
{
|
||||
// Arrange
|
||||
UpdateBookCommand bookCommand = _commandBookFixture.Create(includeOptionalProperties: false);
|
||||
UpdateBookCommand bookCommand = _commandBookFixture.Create(includeFormat: false, includeEdition: false, includeVolumeNumber: false, includeAsin: false, includeGoodreadsId: false, includeLccn: false, includeOclcNumber: false, includeOpenLibraryId: false, includeLibraryThingId: false, includeGoogleBooksId: false, includeBarnesAndNobleId: false, includeAppleBooksId: false, includeIsbns: false, includeRatings: false, includeContributors: false);
|
||||
|
||||
// Act
|
||||
List<Error> result = _validator.TestValidate(bookCommand);
|
||||
@@ -1578,7 +1578,7 @@ public class UpdateBookCommandValidatorTests
|
||||
public void Validate_WhenCalledWithNullRatings_ShouldHaveValidationError()
|
||||
{
|
||||
// Arrange
|
||||
UpdateBookCommand bookCommand = _commandBookFixture.Create(includeOptionalProperties: false);
|
||||
UpdateBookCommand bookCommand = _commandBookFixture.Create(includeFormat: false, includeEdition: false, includeVolumeNumber: false, includeAsin: false, includeGoodreadsId: false, includeLccn: false, includeOclcNumber: false, includeOpenLibraryId: false, includeLibraryThingId: false, includeGoogleBooksId: false, includeBarnesAndNobleId: false, includeAppleBooksId: false, includeIsbns: false, includeRatings: false, includeContributors: false);
|
||||
|
||||
// Act
|
||||
List<Error> result = _validator.TestValidate(bookCommand);
|
||||
@@ -1656,7 +1656,7 @@ public class UpdateBookCommandValidatorTests
|
||||
public void Validate_WhenCalledWithNullVoteCount_ShouldNotHaveValidationError()
|
||||
{
|
||||
// Arrange
|
||||
UpdateBookCommand bookCommand = _commandBookFixture.Create(ratings: [_bookRatingDtoFixture.Create(includeOptionalProperties: false)]);
|
||||
UpdateBookCommand bookCommand = _commandBookFixture.Create(ratings: [_bookRatingDtoFixture.Create(includeSource: false, includeVoteCount: false)]);
|
||||
|
||||
// Act
|
||||
List<Error> result = _validator.TestValidate(bookCommand);
|
||||
|
||||
Reference in new issue
Block a user