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

@@ -21,18 +21,18 @@ public class ThemeNavEntryDtoFixture
/// </summary>
/// <param name="label">Optional label of the entry.</param>
/// <param name="url">Optional URL of the link, or <see langword="null"/> for a submenu.</param>
/// <param name="includeUrl">Whether the URL should be included, or forced to <see langword="null"/>.</param>
/// <param name="cssClass">Optional CSS classes of the link.</param>
/// <param name="includeCssClass">Whether the CSS class should be included, or forced to <see langword="null"/>.</param>
/// <param name="children">Optional child links of a submenu.</param>
/// <param name="includeUrl">Whether the URL should be included, or forced to <see langword="null"/>.</param>
/// <param name="includeCssClass">Whether the CSS class should be included, or forced to <see langword="null"/>.</param>
/// <returns>The created <see cref="ThemeNavEntryDto"/>.</returns>
public ThemeNavEntryDto Create(
string? label = null,
string? url = null,
bool includeUrl = false,
string? cssClass = null,
bool includeCssClass = false,
IReadOnlyList<ThemeNavEntryDto>? children = null)
IReadOnlyList<ThemeNavEntryDto>? children = null,
bool includeUrl = false,
bool includeCssClass = false)
{
return new ThemeNavEntryDto(
Label: label ?? _faker.Lorem.Word(),
@@ -28,12 +28,12 @@ public class ThemeResponseDtoFixture
/// <param name="author">Optional author of the theme.</param>
/// <param name="version">Optional semantic version of the theme.</param>
/// <param name="previewPath">Optional preview image path of the theme, or <see langword="null"/> when the theme has no preview.</param>
/// <param name="includePreviewPath">Whether the preview path should be included, or forced to <see langword="null"/>.</param>
/// <param name="installSource">Optional source the theme was installed from.</param>
/// <param name="isCurrent">Optional value indicating whether the theme is the active one.</param>
/// <param name="includeIsCurrent">Whether the currently active flag should be included, or forced to <see langword="null"/>.</param>
/// <param name="installedAtUtc">Optional UTC timestamp at which the theme was installed.</param>
/// <param name="isDeleted">Optional value indicating whether the theme was deleted by the user.</param>
/// <param name="includePreviewPath">Whether the preview path should be included, or forced to <see langword="null"/>.</param>
/// <param name="includeIsCurrent">Whether the currently active flag should be included, or forced to <see langword="null"/>.</param>
/// <returns>A configured <see cref="ThemeResponseDto"/> instance.</returns>
public ThemeResponseDto Create(
Guid? id = null,
@@ -43,12 +43,12 @@ public class ThemeResponseDtoFixture
string? author = null,
string? version = null,
string? previewPath = null,
bool includePreviewPath = false,
ThemeInstallSource? installSource = null,
bool? isCurrent = null,
bool includeIsCurrent = false,
DateTime? installedAtUtc = null,
bool? isDeleted = null)
bool? isDeleted = null,
bool includePreviewPath = false,
bool includeIsCurrent = false)
{
return new ThemeResponseDto(
Id: id ?? Guid.NewGuid(),
@@ -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
};
}