mirror of
https://github.com/BinaryAlley/Nemera.git
synced 2026-12-03 18:13:42 +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
+30
-12
@@ -53,7 +53,16 @@ public class AddTrackRequestFixture
|
||||
/// <param name="includePath">Whether the path should be included, 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="includeTrackNumber">Whether the track number should be included, or forced to <see langword="null"/>.</param>
|
||||
/// <param name="includeOptionalProperties">Whether the properties that are not explicitly provided should be randomized, or forced to <see langword="null"/>.</param>
|
||||
/// <param name="includeDiscNumber">Whether the disc number should be included, or forced to <see langword="null"/>.</param>
|
||||
/// <param name="includeScript">Whether the script should be included, or forced to <see langword="null"/>.</param>
|
||||
/// <param name="includeKey">Whether the musical key should be included, or forced to <see langword="null"/>.</param>
|
||||
/// <param name="includeBpm">Whether the tempo should be included, or forced to <see langword="null"/>.</param>
|
||||
/// <param name="includeWork">Whether the work should be included, or forced to <see langword="null"/>.</param>
|
||||
/// <param name="includeMusicBrainzRecordingId">Whether the MusicBrainz recording Id should be included, or forced to <see langword="null"/>.</param>
|
||||
/// <param name="includeMusicBrainzTrackId">Whether the MusicBrainz track Id should be included, or forced to <see langword="null"/>.</param>
|
||||
/// <param name="includeMusicBrainzWorkId">Whether the MusicBrainz work Id should be included, or forced to <see langword="null"/>.</param>
|
||||
/// <param name="includeMoods">Whether the moods should be included, or forced to <see langword="null"/>.</param>
|
||||
/// <param name="includeIsrcs">Whether the ISRC codes 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>The created request to add a track.</returns>
|
||||
@@ -76,7 +85,16 @@ public class AddTrackRequestFixture
|
||||
bool includePath = true,
|
||||
bool includeMetadata = true,
|
||||
bool includeTrackNumber = true,
|
||||
bool includeOptionalProperties = true,
|
||||
bool includeDiscNumber = true,
|
||||
bool includeScript = true,
|
||||
bool includeKey = true,
|
||||
bool includeBpm = true,
|
||||
bool includeWork = true,
|
||||
bool includeMusicBrainzRecordingId = true,
|
||||
bool includeMusicBrainzTrackId = true,
|
||||
bool includeMusicBrainzWorkId = true,
|
||||
bool includeMoods = true,
|
||||
bool includeIsrcs = true,
|
||||
bool includeContributors = true,
|
||||
bool includeRatings = true)
|
||||
{
|
||||
@@ -84,16 +102,16 @@ public class AddTrackRequestFixture
|
||||
includePath ? path ?? Path.Combine(Path.GetTempPath(), "lumina-tracks", _faker.System.FileName()) : null,
|
||||
includeMetadata ? metadata ?? _audioMetadataDtoFixture.Create() : null,
|
||||
includeTrackNumber ? trackNumber ?? _faker.Random.Int(1, 30) : null,
|
||||
includeOptionalProperties ? discNumber ?? _faker.Random.Int(1, 3) : null,
|
||||
includeOptionalProperties ? script ?? _faker.Random.AlphaNumeric(4) : null,
|
||||
includeOptionalProperties ? key ?? _faker.PickRandom<MusicKey>() : null,
|
||||
includeOptionalProperties ? bpm ?? _faker.Random.Int(40, 220) : null,
|
||||
includeOptionalProperties ? work ?? _faker.Lorem.Sentence() : null,
|
||||
includeOptionalProperties ? musicBrainzRecordingId ?? _faker.Random.Guid() : null,
|
||||
includeOptionalProperties ? musicBrainzTrackId ?? _faker.Random.Guid() : null,
|
||||
includeOptionalProperties ? musicBrainzWorkId ?? _faker.Random.Guid() : null,
|
||||
includeOptionalProperties ? moods ?? _moodDtoFixture.CreateMany(_faker.Random.Int(1, 3)) : null,
|
||||
includeOptionalProperties ? isrcs ?? _isrcDtoFixture.CreateMany(_faker.Random.Int(1, 3)) : null,
|
||||
includeDiscNumber ? discNumber ?? _faker.Random.Int(1, 3) : null,
|
||||
includeScript ? script ?? _faker.Random.AlphaNumeric(4) : null,
|
||||
includeKey ? key ?? _faker.PickRandom<MusicKey>() : null,
|
||||
includeBpm ? bpm ?? _faker.Random.Int(40, 220) : null,
|
||||
includeWork ? work ?? _faker.Lorem.Sentence() : null,
|
||||
includeMusicBrainzRecordingId ? musicBrainzRecordingId ?? _faker.Random.Guid() : null,
|
||||
includeMusicBrainzTrackId ? musicBrainzTrackId ?? _faker.Random.Guid() : null,
|
||||
includeMusicBrainzWorkId ? musicBrainzWorkId ?? _faker.Random.Guid() : null,
|
||||
includeMoods ? moods ?? _moodDtoFixture.CreateMany(_faker.Random.Int(1, 3)) : null,
|
||||
includeIsrcs ? isrcs ?? _isrcDtoFixture.CreateMany(_faker.Random.Int(1, 3)) : null,
|
||||
includeContributors ? contributors ?? _mediaContributorReferenceDtoFixture.CreateMany(_faker.Random.Int(1, 3)) : null,
|
||||
includeRatings ? ratings ?? _audioRatingDtoFixture.CreateMany(_faker.Random.Int(1, 3)) : null);
|
||||
}
|
||||
|
||||
+30
-12
@@ -49,7 +49,16 @@ public class UpdateTrackRequestFixture
|
||||
/// <param name="isrcs">Optional. The ISRC codes of the track.</param>
|
||||
/// <param name="contributors">Optional. The media contributors that performed on the track.</param>
|
||||
/// <param name="ratings">Optional. The ratings of the track.</param>
|
||||
/// <param name="includeOptionalProperties">Whether the optional properties that are not explicitly provided should be randomized, or forced to <see langword="null"/>.</param>
|
||||
/// <param name="includeDiscNumber">Whether the disc number should be included, or forced to <see langword="null"/>.</param>
|
||||
/// <param name="includeScript">Whether the script should be included, or forced to <see langword="null"/>.</param>
|
||||
/// <param name="includeKey">Whether the musical key should be included, or forced to <see langword="null"/>.</param>
|
||||
/// <param name="includeBpm">Whether the tempo should be included, or forced to <see langword="null"/>.</param>
|
||||
/// <param name="includeWork">Whether the work should be included, or forced to <see langword="null"/>.</param>
|
||||
/// <param name="includeMusicBrainzRecordingId">Whether the MusicBrainz recording Id should be included, or forced to <see langword="null"/>.</param>
|
||||
/// <param name="includeMusicBrainzTrackId">Whether the MusicBrainz track Id should be included, or forced to <see langword="null"/>.</param>
|
||||
/// <param name="includeMusicBrainzWorkId">Whether the MusicBrainz work Id should be included, or forced to <see langword="null"/>.</param>
|
||||
/// <param name="includeMoods">Whether the moods should be included, or forced to <see langword="null"/>.</param>
|
||||
/// <param name="includeIsrcs">Whether the ISRC codes should be included, or forced to <see langword="null"/>.</param>
|
||||
/// <param name="includeContributors">Whether the contributors list should be included, or forced to <see langword="null"/>.</param>
|
||||
/// <param name="includeRatings">Whether the ratings list should be included, or forced to <see langword="null"/>.</param>
|
||||
/// <param name="includePath">Whether the path should be included, or forced to <see langword="null"/>.</param>
|
||||
@@ -72,7 +81,16 @@ public class UpdateTrackRequestFixture
|
||||
List<IsrcDto>? isrcs = null,
|
||||
List<MediaContributorReferenceDto>? contributors = null,
|
||||
List<AudioRatingDto>? ratings = null,
|
||||
bool includeOptionalProperties = true,
|
||||
bool includeDiscNumber = true,
|
||||
bool includeScript = true,
|
||||
bool includeKey = true,
|
||||
bool includeBpm = true,
|
||||
bool includeWork = true,
|
||||
bool includeMusicBrainzRecordingId = true,
|
||||
bool includeMusicBrainzTrackId = true,
|
||||
bool includeMusicBrainzWorkId = true,
|
||||
bool includeMoods = true,
|
||||
bool includeIsrcs = true,
|
||||
bool includeContributors = true,
|
||||
bool includeRatings = true,
|
||||
bool includePath = true,
|
||||
@@ -83,16 +101,16 @@ public class UpdateTrackRequestFixture
|
||||
includePath ? (path ?? _faker.System.FilePath()) : null,
|
||||
includeMetadata ? (metadata ?? _audioMetadataDtoFixture.Create()) : null,
|
||||
includeTrackNumber ? (trackNumber ?? _faker.Random.Int(1, 20)) : null,
|
||||
includeOptionalProperties ? (discNumber ?? _faker.Random.Int(1, 3)) : null,
|
||||
includeOptionalProperties ? (script ?? _faker.Random.String2(_faker.Random.Number(1, 50))) : null,
|
||||
includeOptionalProperties ? (key ?? _faker.PickRandom<MusicKey>()) : null,
|
||||
includeOptionalProperties ? (bpm ?? _faker.Random.Int(40, 240)) : null,
|
||||
includeOptionalProperties ? (work ?? _faker.Music.Genre()) : null,
|
||||
includeOptionalProperties ? (musicBrainzRecordingId ?? _faker.Random.Guid()) : null,
|
||||
includeOptionalProperties ? (musicBrainzTrackId ?? _faker.Random.Guid()) : null,
|
||||
includeOptionalProperties ? (musicBrainzWorkId ?? _faker.Random.Guid()) : null,
|
||||
includeOptionalProperties ? (moods ?? [.. _moodDtoFixture.CreateMany(_faker.Random.Int(1, 3))]) : null,
|
||||
includeOptionalProperties ? (isrcs ?? [.. _isrcDtoFixture.CreateMany(_faker.Random.Int(1, 3))]) : null,
|
||||
includeDiscNumber ? (discNumber ?? _faker.Random.Int(1, 3)) : null,
|
||||
includeScript ? (script ?? _faker.Random.String2(_faker.Random.Number(1, 50))) : null,
|
||||
includeKey ? (key ?? _faker.PickRandom<MusicKey>()) : null,
|
||||
includeBpm ? (bpm ?? _faker.Random.Int(40, 240)) : null,
|
||||
includeWork ? (work ?? _faker.Music.Genre()) : null,
|
||||
includeMusicBrainzRecordingId ? (musicBrainzRecordingId ?? _faker.Random.Guid()) : null,
|
||||
includeMusicBrainzTrackId ? (musicBrainzTrackId ?? _faker.Random.Guid()) : null,
|
||||
includeMusicBrainzWorkId ? (musicBrainzWorkId ?? _faker.Random.Guid()) : null,
|
||||
includeMoods ? (moods ?? [.. _moodDtoFixture.CreateMany(_faker.Random.Int(1, 3))]) : null,
|
||||
includeIsrcs ? (isrcs ?? [.. _isrcDtoFixture.CreateMany(_faker.Random.Int(1, 3))]) : null,
|
||||
includeContributors ? (contributors ?? [.. _mediaContributorReferenceDtoFixture.CreateMany(_faker.Random.Int(1, 3))]) : null,
|
||||
includeRatings ? (ratings ?? [.. _audioRatingDtoFixture.CreateMany(_faker.Random.Int(1, 3))]) : null);
|
||||
}
|
||||
|
||||
+45
-17
@@ -49,7 +49,21 @@ public class AddBookRequestFixture
|
||||
/// <param name="isbns">Optional. The ISBNs of the book.</param>
|
||||
/// <param name="contributors">Optional. The contributors of the book.</param>
|
||||
/// <param name="ratings">Optional. The ratings 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="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="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="includeRatings">Whether the ratings 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>
|
||||
/// <returns>The created request to add a book.</returns>
|
||||
public AddBookRequest Create(
|
||||
string? path = null,
|
||||
@@ -70,7 +84,21 @@ public class AddBookRequestFixture
|
||||
List<IsbnDto>? isbns = null,
|
||||
List<MediaContributorReferenceDto>? contributors = null,
|
||||
List<BookRatingDto>? ratings = null,
|
||||
bool includeOptionalProperties = true)
|
||||
bool includeFormat = true,
|
||||
bool includeEdition = true,
|
||||
bool includeVolumeNumber = 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 includeRatings = true,
|
||||
bool includeContributors = true)
|
||||
{
|
||||
return new Faker<AddBookRequest>()
|
||||
.CustomInstantiator(f => new AddBookRequest(
|
||||
@@ -95,22 +123,22 @@ public class AddBookRequestFixture
|
||||
))
|
||||
.RuleFor(x => x.Path, f => path ?? Path.Combine(Path.GetTempPath(), "lumina-books", f.System.FileName()))
|
||||
.RuleFor(x => x.Metadata, metadata ?? _writtenContentMetadataDtoFixture.Create())
|
||||
.RuleFor(x => x.Format, f => format ?? (includeOptionalProperties ? f.PickRandom<BookFormat>() : null))
|
||||
.RuleFor(x => x.Edition, f => edition ?? (includeOptionalProperties ? f.Random.String2(f.Random.Number(1, 50)) : null))
|
||||
.RuleFor(x => x.VolumeNumber, f => volumeNumber ?? (includeOptionalProperties ? (float?)f.Random.Number(1, 3) : null))
|
||||
.RuleFor(x => x.Format, f => format ?? (includeFormat ? f.PickRandom<BookFormat>() : null))
|
||||
.RuleFor(x => x.Edition, f => edition ?? (includeEdition ? f.Random.String2(f.Random.Number(1, 50)) : null))
|
||||
.RuleFor(x => x.VolumeNumber, f => volumeNumber ?? (includeVolumeNumber ? (float?)f.Random.Number(1, 3) : null))
|
||||
.RuleFor(x => x.Series, series)
|
||||
.RuleFor(x => x.ASIN, f => asin ?? (includeOptionalProperties ? f.Random.String2(10) : null))
|
||||
.RuleFor(x => x.GoodreadsId, f => goodreadsId ?? (includeOptionalProperties ? f.Random.Number(100000, 500000).ToString() : null))
|
||||
.RuleFor(x => x.LCCN, f => lccn ?? (includeOptionalProperties ? CreateLccn(f) : null))
|
||||
.RuleFor(x => x.OCLCNumber, f => oclcNumber ?? (includeOptionalProperties ? CreateOclcNumber(f) : null))
|
||||
.RuleFor(x => x.OpenLibraryId, f => openLibraryId ?? (includeOptionalProperties ? CreateOpenLibraryId(f) : null))
|
||||
.RuleFor(x => x.LibraryThingId, f => libraryThingId ?? (includeOptionalProperties ? f.Random.String2(f.Random.Number(1, 50)) : null))
|
||||
.RuleFor(x => x.GoogleBooksId, f => googleBooksId ?? (includeOptionalProperties ? CreateGoogleBooksId(f) : null))
|
||||
.RuleFor(x => x.BarnesAndNobleId, f => barnesAndNobleId ?? (includeOptionalProperties ? f.Random.String2(10, "0123456789") : null))
|
||||
.RuleFor(x => x.AppleBooksId, f => appleBooksId ?? (includeOptionalProperties ? $"id{f.Random.Number(1, 999999)}" : null))
|
||||
.RuleFor(p => p.ISBNs, f => isbns ?? (includeOptionalProperties ? [.. _isbnDtoFixture.CreateMany(f.Random.Number(1, 3))] : null))
|
||||
.RuleFor(p => p.Ratings, f => ratings ?? (includeOptionalProperties ? [.. _bookRatingDtoFixture.CreateMany(f.Random.Number(1, 3))] : null))
|
||||
.RuleFor(x => x.Contributors, f => contributors ?? (includeOptionalProperties ? [.. _mediaContributorReferenceDtoFixture.CreateMany(f.Random.Number(1, 3))] : null));
|
||||
.RuleFor(x => x.ASIN, f => asin ?? (includeAsin ? f.Random.String2(10) : null))
|
||||
.RuleFor(x => x.GoodreadsId, f => goodreadsId ?? (includeGoodreadsId ? f.Random.Number(100000, 500000).ToString() : null))
|
||||
.RuleFor(x => x.LCCN, f => lccn ?? (includeLccn ? CreateLccn(f) : null))
|
||||
.RuleFor(x => x.OCLCNumber, f => oclcNumber ?? (includeOclcNumber ? CreateOclcNumber(f) : null))
|
||||
.RuleFor(x => x.OpenLibraryId, f => openLibraryId ?? (includeOpenLibraryId ? CreateOpenLibraryId(f) : null))
|
||||
.RuleFor(x => x.LibraryThingId, f => libraryThingId ?? (includeLibraryThingId ? f.Random.String2(f.Random.Number(1, 50)) : null))
|
||||
.RuleFor(x => x.GoogleBooksId, f => googleBooksId ?? (includeGoogleBooksId ? CreateGoogleBooksId(f) : null))
|
||||
.RuleFor(x => x.BarnesAndNobleId, f => barnesAndNobleId ?? (includeBarnesAndNobleId ? f.Random.String2(10, "0123456789") : null))
|
||||
.RuleFor(x => x.AppleBooksId, f => appleBooksId ?? (includeAppleBooksId ? $"id{f.Random.Number(1, 999999)}" : null))
|
||||
.RuleFor(p => p.ISBNs, f => isbns ?? (includeIsbns ? [.. _isbnDtoFixture.CreateMany(f.Random.Number(1, 3))] : null))
|
||||
.RuleFor(p => p.Ratings, f => ratings ?? (includeRatings ? [.. _bookRatingDtoFixture.CreateMany(f.Random.Number(1, 3))] : null))
|
||||
.RuleFor(x => x.Contributors, f => contributors ?? (includeContributors ? [.. _mediaContributorReferenceDtoFixture.CreateMany(f.Random.Number(1, 3))] : null));
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
||||
+45
-17
@@ -47,7 +47,21 @@ public class UpdateBookRequestFixture
|
||||
/// <param name="isbns">Optional. The ISBNs of the book.</param>
|
||||
/// <param name="contributors">Optional. The contributors of the book.</param>
|
||||
/// <param name="ratings">Optional. The ratings 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="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="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="includeRatings">Whether the ratings 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>
|
||||
/// <returns>The created request to update a book.</returns>
|
||||
public UpdateBookRequest Create(
|
||||
WrittenContentMetadataDto? metadata = null,
|
||||
@@ -67,7 +81,21 @@ public class UpdateBookRequestFixture
|
||||
List<IsbnDto>? isbns = null,
|
||||
List<MediaContributorReferenceDto>? contributors = null,
|
||||
List<BookRatingDto>? ratings = null,
|
||||
bool includeOptionalProperties = true)
|
||||
bool includeFormat = true,
|
||||
bool includeEdition = true,
|
||||
bool includeVolumeNumber = 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 includeRatings = true,
|
||||
bool includeContributors = true)
|
||||
{
|
||||
return new Faker<UpdateBookRequest>()
|
||||
.CustomInstantiator(f => new UpdateBookRequest(
|
||||
@@ -90,22 +118,22 @@ public class UpdateBookRequestFixture
|
||||
default!
|
||||
))
|
||||
.RuleFor(x => x.Metadata, metadata ?? _writtenContentMetadataDtoFixture.Create())
|
||||
.RuleFor(x => x.Format, f => format ?? (includeOptionalProperties ? f.PickRandom<BookFormat>() : null))
|
||||
.RuleFor(x => x.Edition, f => edition ?? (includeOptionalProperties ? f.Random.String2(f.Random.Number(1, 50)) : null))
|
||||
.RuleFor(x => x.VolumeNumber, f => volumeNumber ?? (includeOptionalProperties ? (float?)f.Random.Number(1, 3) : null))
|
||||
.RuleFor(x => x.Format, f => format ?? (includeFormat ? f.PickRandom<BookFormat>() : null))
|
||||
.RuleFor(x => x.Edition, f => edition ?? (includeEdition ? f.Random.String2(f.Random.Number(1, 50)) : null))
|
||||
.RuleFor(x => x.VolumeNumber, f => volumeNumber ?? (includeVolumeNumber ? (float?)f.Random.Number(1, 3) : null))
|
||||
.RuleFor(x => x.Series, series)
|
||||
.RuleFor(x => x.ASIN, f => asin ?? (includeOptionalProperties ? f.Random.String2(10) : null))
|
||||
.RuleFor(x => x.GoodreadsId, f => goodreadsId ?? (includeOptionalProperties ? f.Random.Number(100000, 500000).ToString() : null))
|
||||
.RuleFor(x => x.LCCN, f => lccn ?? (includeOptionalProperties ? CreateLccn(f) : null))
|
||||
.RuleFor(x => x.OCLCNumber, f => oclcNumber ?? (includeOptionalProperties ? CreateOclcNumber(f) : null))
|
||||
.RuleFor(x => x.OpenLibraryId, f => openLibraryId ?? (includeOptionalProperties ? CreateOpenLibraryId(f) : null))
|
||||
.RuleFor(x => x.LibraryThingId, f => libraryThingId ?? (includeOptionalProperties ? f.Random.String2(f.Random.Number(1, 50)) : null))
|
||||
.RuleFor(x => x.GoogleBooksId, f => googleBooksId ?? (includeOptionalProperties ? CreateGoogleBooksId(f) : null))
|
||||
.RuleFor(x => x.BarnesAndNobleId, f => barnesAndNobleId ?? (includeOptionalProperties ? f.Random.String2(10, "0123456789") : null))
|
||||
.RuleFor(x => x.AppleBooksId, f => appleBooksId ?? (includeOptionalProperties ? $"id{f.Random.Number(1, 999999)}" : null))
|
||||
.RuleFor(p => p.ISBNs, f => isbns ?? (includeOptionalProperties ? [.. _isbnDtoFixture.CreateMany(f.Random.Number(1, 3))] : null))
|
||||
.RuleFor(p => p.Ratings, f => ratings ?? (includeOptionalProperties ? [.. _bookRatingDtoFixture.CreateMany(f.Random.Number(1, 3))] : null))
|
||||
.RuleFor(x => x.Contributors, f => contributors ?? (includeOptionalProperties ? [.. _mediaContributorReferenceDtoFixture.CreateMany(f.Random.Number(1, 3))] : null));
|
||||
.RuleFor(x => x.ASIN, f => asin ?? (includeAsin ? f.Random.String2(10) : null))
|
||||
.RuleFor(x => x.GoodreadsId, f => goodreadsId ?? (includeGoodreadsId ? f.Random.Number(100000, 500000).ToString() : null))
|
||||
.RuleFor(x => x.LCCN, f => lccn ?? (includeLccn ? CreateLccn(f) : null))
|
||||
.RuleFor(x => x.OCLCNumber, f => oclcNumber ?? (includeOclcNumber ? CreateOclcNumber(f) : null))
|
||||
.RuleFor(x => x.OpenLibraryId, f => openLibraryId ?? (includeOpenLibraryId ? CreateOpenLibraryId(f) : null))
|
||||
.RuleFor(x => x.LibraryThingId, f => libraryThingId ?? (includeLibraryThingId ? f.Random.String2(f.Random.Number(1, 50)) : null))
|
||||
.RuleFor(x => x.GoogleBooksId, f => googleBooksId ?? (includeGoogleBooksId ? CreateGoogleBooksId(f) : null))
|
||||
.RuleFor(x => x.BarnesAndNobleId, f => barnesAndNobleId ?? (includeBarnesAndNobleId ? f.Random.String2(10, "0123456789") : null))
|
||||
.RuleFor(x => x.AppleBooksId, f => appleBooksId ?? (includeAppleBooksId ? $"id{f.Random.Number(1, 999999)}" : null))
|
||||
.RuleFor(p => p.ISBNs, f => isbns ?? (includeIsbns ? [.. _isbnDtoFixture.CreateMany(f.Random.Number(1, 3))] : null))
|
||||
.RuleFor(p => p.Ratings, f => ratings ?? (includeRatings ? [.. _bookRatingDtoFixture.CreateMany(f.Random.Number(1, 3))] : null))
|
||||
.RuleFor(x => x.Contributors, f => contributors ?? (includeContributors ? [.. _mediaContributorReferenceDtoFixture.CreateMany(f.Random.Number(1, 3))] : null));
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
||||
Reference in new issue
Block a user