Removes the umbrella include flag from the fixtures and their consumers

This commit is contained in:
BinaryAlley committed 2026-09-27 23:05:06 +03:00
1 parent ab5cbfb949
commit 4d96fe10dd
43 files changed
+930 -349

No files matched your search

@@ -33,35 +33,67 @@ public class UpdateBookRequestFixture
/// <param name="id">Optional Id of the book to update.</param>
/// <param name="libraryId">Optional Id of the media library the book belongs to.</param>
/// <param name="metadata">Optional written content metadata of the book.</param>
/// <param name="includeOptionalProperties">Whether the properties that are not explicitly provided should be randomized, or forced to <see langword="null"/>.</param>
/// <param name="includeMetadata">Whether the metadata should be included, or forced to <see langword="null"/>.</param>
/// <param name="includeFormat">Whether the format should be included, or forced to <see langword="null"/>.</param>
/// <param name="includeEdition">Whether the edition should be included, or forced to <see langword="null"/>.</param>
/// <param name="includeVolumeNumber">Whether the volume number should be included, or forced to <see langword="null"/>.</param>
/// <param name="includeSeries">Whether the series should be included, or forced to <see langword="null"/>.</param>
/// <param name="includeAsin">Whether the ASIN should be included, or forced to <see langword="null"/>.</param>
/// <param name="includeGoodreadsId">Whether the Goodreads Id should be included, or forced to <see langword="null"/>.</param>
/// <param name="includeLccn">Whether the LCCN should be included, or forced to <see langword="null"/>.</param>
/// <param name="includeOclcNumber">Whether the OCLC number should be included, or forced to <see langword="null"/>.</param>
/// <param name="includeOpenLibraryId">Whether the Open Library Id should be included, or forced to <see langword="null"/>.</param>
/// <param name="includeLibraryThingId">Whether the LibraryThing Id should be included, or forced to <see langword="null"/>.</param>
/// <param name="includeGoogleBooksId">Whether the Google Books Id should be included, or forced to <see langword="null"/>.</param>
/// <param name="includeBarnesAndNobleId">Whether the Barnes and Noble Id should be included, or forced to <see langword="null"/>.</param>
/// <param name="includeAppleBooksId">Whether the Apple Books Id should be included, or forced to <see langword="null"/>.</param>
/// <param name="includeIsbns">Whether the ISBNs should be included, or forced to <see langword="null"/>.</param>
/// <param name="includeContributors">Whether the contributors should be included, or forced to <see langword="null"/>.</param>
/// <param name="includeRatings">Whether the ratings should be included, or forced to <see langword="null"/>.</param>
/// <returns>A configured <see cref="UpdateBookRequest"/> instance.</returns>
public UpdateBookRequest Create(
Guid? id = null,
Guid? libraryId = null,
WrittenContentMetadataDto? metadata = null,
bool includeOptionalProperties = true)
bool includeMetadata = true,
bool includeFormat = true,
bool includeEdition = true,
bool includeVolumeNumber = true,
bool includeSeries = true,
bool includeAsin = true,
bool includeGoodreadsId = true,
bool includeLccn = true,
bool includeOclcNumber = true,
bool includeOpenLibraryId = true,
bool includeLibraryThingId = true,
bool includeGoogleBooksId = true,
bool includeBarnesAndNobleId = true,
bool includeAppleBooksId = true,
bool includeIsbns = true,
bool includeContributors = true,
bool includeRatings = true)
{
return new UpdateBookRequest
{
BookId = id?.ToString() ?? Guid.NewGuid().ToString(),
LibraryId = libraryId ?? Guid.NewGuid(),
Metadata = metadata ?? (includeOptionalProperties ? _writtenContentMetadataDtoFixture.Create() : null),
Format = includeOptionalProperties ? _faker.PickRandom<BookFormat>() : null,
Edition = includeOptionalProperties ? _faker.Random.String2(_faker.Random.Number(1, 50)) : null,
VolumeNumber = includeOptionalProperties ? _faker.Random.Number(1, 3) : null,
Series = includeOptionalProperties ? _bookSeriesDtoFixture.Create() : null,
ASIN = includeOptionalProperties ? _faker.Random.String2(10) : null,
GoodreadsId = includeOptionalProperties ? _faker.Random.Number(100000, 500000).ToString() : null,
LCCN = includeOptionalProperties ? "n78890351" : null,
OCLCNumber = includeOptionalProperties ? "ocm12345678" : null,
OpenLibraryId = includeOptionalProperties ? "OL123456M" : null,
LibraryThingId = includeOptionalProperties ? _faker.Random.String2(_faker.Random.Number(1, 50)) : null,
GoogleBooksId = includeOptionalProperties ? CreateGoogleBooksId() : null,
BarnesAndNobleId = includeOptionalProperties ? _faker.Random.String2(10, "0123456789") : null,
AppleBooksId = includeOptionalProperties ? $"id{_faker.Random.Number(1, 999999)}" : null,
ISBNs = includeOptionalProperties ? [.. _isbnDtoFixture.CreateMany(_faker.Random.Number(1, 3))] : null,
Contributors = includeOptionalProperties ? [.. _mediaContributorDtoFixture.CreateMany(_faker.Random.Number(1, 3))] : null,
Ratings = includeOptionalProperties ? [.. _bookRatingDtoFixture.CreateMany(_faker.Random.Number(1, 3))] : null
Metadata = includeMetadata ? (metadata ?? _writtenContentMetadataDtoFixture.Create()) : null,
Format = includeFormat ? _faker.PickRandom<BookFormat>() : null,
Edition = includeEdition ? _faker.Random.String2(_faker.Random.Number(1, 50)) : null,
VolumeNumber = includeVolumeNumber ? _faker.Random.Number(1, 3) : null,
Series = includeSeries ? _bookSeriesDtoFixture.Create() : null,
ASIN = includeAsin ? _faker.Random.String2(10) : null,
GoodreadsId = includeGoodreadsId ? _faker.Random.Number(100000, 500000).ToString() : null,
LCCN = includeLccn ? "n78890351" : null,
OCLCNumber = includeOclcNumber ? "ocm12345678" : null,
OpenLibraryId = includeOpenLibraryId ? "OL123456M" : null,
LibraryThingId = includeLibraryThingId ? _faker.Random.String2(_faker.Random.Number(1, 50)) : null,
GoogleBooksId = includeGoogleBooksId ? CreateGoogleBooksId() : null,
BarnesAndNobleId = includeBarnesAndNobleId ? _faker.Random.String2(10, "0123456789") : null,
AppleBooksId = includeAppleBooksId ? $"id{_faker.Random.Number(1, 999999)}" : null,
ISBNs = includeIsbns ? [.. _isbnDtoFixture.CreateMany(_faker.Random.Number(1, 3))] : null,
Contributors = includeContributors ? [.. _mediaContributorDtoFixture.CreateMany(_faker.Random.Number(1, 3))] : null,
Ratings = includeRatings ? [.. _bookRatingDtoFixture.CreateMany(_faker.Random.Number(1, 3))] : null
};
}