mirror of
https://github.com/BinaryAlley/Nemera.git
synced 2026-12-02 17: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
+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
|
||||
|
||||
Reference in new issue
Block a user