diff --git a/tests/Common/Lumina.Application.Fixtures/Common/DTO/MediaLibrary/AudioLibrary/MusicLibrary/Tracks/TrackLiteRowFixture.cs b/tests/Common/Lumina.Application.Fixtures/Common/DTO/MediaLibrary/AudioLibrary/MusicLibrary/Tracks/TrackLiteRowFixture.cs
new file mode 100644
index 00000000..d7414256
--- /dev/null
+++ b/tests/Common/Lumina.Application.Fixtures/Common/DTO/MediaLibrary/AudioLibrary/MusicLibrary/Tracks/TrackLiteRowFixture.cs
@@ -0,0 +1,54 @@
+#region ========================================================================= USING =====================================================================================
+using Bogus;
+using Lumina.Application.Common.DTO.MediaLibrary.AudioLibrary.MusicLibrary.Tracks;
+using System;
+using System.Collections.Generic;
+using System.Diagnostics.CodeAnalysis;
+using System.Linq;
+#endregion
+
+namespace Lumina.Application.Fixtures.Common.DTO.MediaLibrary.AudioLibrary.MusicLibrary.Tracks;
+
+///
+/// Fixture class for the class.
+///
+[ExcludeFromCodeCoverage]
+public class TrackLiteRowFixture
+{
+ private readonly Faker _faker = new();
+
+ ///
+ /// Creates a random valid .
+ ///
+ /// Optional. The Id of the track.
+ /// Optional. The title of the track.
+ /// Optional. The number of the track on its disc.
+ /// Optional. The number of the disc the track belongs to.
+ /// Whether the disc number should be included, or forced to .
+ /// The created .
+ public TrackLiteRow Create(
+ Guid? id = null,
+ string? title = null,
+ int? trackNumber = null,
+ int? discNumber = null,
+ bool includeDiscNumber = true)
+ {
+ return new TrackLiteRow
+ {
+ Id = id ?? _faker.Random.Guid(),
+ Title = title ?? _faker.Lorem.Sentence(),
+ TrackNumber = trackNumber ?? _faker.Random.Int(1, 30),
+ DiscNumber = includeDiscNumber ? (discNumber ?? _faker.Random.Int(1, 3)) : null
+ };
+ }
+
+ ///
+ /// Creates a list of instances with randomized test data.
+ ///
+ /// Number of instances to create.
+ /// List of configured instances.
+ public List CreateMany(int count = 3)
+ {
+ return [.. Enumerable.Range(0, count).Select(_ => Create())];
+ }
+}
diff --git a/tests/Common/Lumina.Application.Fixtures/Common/DataAccess/Entities/MediaLibrary/AudioLibrary/MusicLibrary/AlbumContributorEntityFixture.cs b/tests/Common/Lumina.Application.Fixtures/Common/DataAccess/Entities/MediaLibrary/AudioLibrary/MusicLibrary/AlbumContributorEntityFixture.cs
new file mode 100644
index 00000000..5b138826
--- /dev/null
+++ b/tests/Common/Lumina.Application.Fixtures/Common/DataAccess/Entities/MediaLibrary/AudioLibrary/MusicLibrary/AlbumContributorEntityFixture.cs
@@ -0,0 +1,60 @@
+#region ========================================================================= USING =====================================================================================
+using Bogus;
+using Lumina.Application.Common.DataAccess.Entities.MediaLibrary.AudioLibrary.MusicLibrary;
+using Lumina.Domain.SharedKernel.Common.Enums.MediaContributors;
+using System;
+using System.Collections.Generic;
+using System.Diagnostics.CodeAnalysis;
+using System.Linq;
+#endregion
+
+namespace Lumina.Application.Fixtures.Common.DataAccess.Entities.MediaLibrary.AudioLibrary.MusicLibrary;
+
+///
+/// Fixture class for the class.
+///
+[ExcludeFromCodeCoverage]
+public class AlbumContributorEntityFixture
+{
+ private readonly Faker _faker = new();
+
+ ///
+ /// Creates a random valid .
+ ///
+ /// Optional. The Id of the participation.
+ /// Optional. The Id of the album the contributor participated in.
+ /// Optional. The Id of the media contributor.
+ /// Optional. The role the contributor played in the album.
+ /// Optional. The Id of the user that created the participation.
+ /// The created .
+ public AlbumContributorEntity Create(
+ Guid? id = null,
+ Guid? albumId = null,
+ Guid? mediaContributorId = null,
+ MediaContributorRole? role = null,
+ Guid? createdBy = null)
+ {
+ return new AlbumContributorEntity
+ {
+ Id = id ?? Guid.NewGuid(),
+ AlbumId = albumId ?? Guid.NewGuid(),
+ MediaContributorId = mediaContributorId ?? Guid.NewGuid(),
+ Role = role ?? _faker.PickRandom(),
+ CreatedOnUtc = _faker.Date.Past(),
+ CreatedBy = createdBy ?? Guid.NewGuid(),
+ UpdatedOnUtc = _faker.Random.Bool() ? _faker.Date.Recent() : null,
+ UpdatedBy = _faker.Random.Bool() ? Guid.NewGuid() : null
+ };
+ }
+
+ ///
+ /// Creates a list of instances with randomized test data.
+ ///
+ /// Number of instances to create.
+ /// Optional. The Id of the album the contributors participated in.
+ /// List of configured instances.
+ public List CreateMany(int count = 3, Guid? albumId = null)
+ {
+ return [.. Enumerable.Range(0, count).Select(_ => Create(albumId: albumId))];
+ }
+}
diff --git a/tests/Common/Lumina.Application.Fixtures/Common/DataAccess/Entities/MediaLibrary/AudioLibrary/MusicLibrary/AlbumEntityFixture.cs b/tests/Common/Lumina.Application.Fixtures/Common/DataAccess/Entities/MediaLibrary/AudioLibrary/MusicLibrary/AlbumEntityFixture.cs
new file mode 100644
index 00000000..3a2c86fb
--- /dev/null
+++ b/tests/Common/Lumina.Application.Fixtures/Common/DataAccess/Entities/MediaLibrary/AudioLibrary/MusicLibrary/AlbumEntityFixture.cs
@@ -0,0 +1,137 @@
+#region ========================================================================= USING =====================================================================================
+using Bogus;
+using Lumina.Application.Common.DataAccess.Entities.Common;
+using Lumina.Application.Common.DataAccess.Entities.MediaLibrary.AudioLibrary.MusicLibrary;
+using Lumina.Application.Fixtures.Common.DataAccess.Entities.Common;
+using Lumina.Application.Fixtures.Common.Setup;
+using Lumina.Domain.SharedKernel.Common.Enums.AudioLibrary;
+using Lumina.Domain.SharedKernel.Common.Enums.Common;
+using System;
+using System.Collections.Generic;
+using System.Diagnostics.CodeAnalysis;
+using System.Linq;
+#endregion
+
+namespace Lumina.Application.Fixtures.Common.DataAccess.Entities.MediaLibrary.AudioLibrary.MusicLibrary;
+
+///
+/// Fixture class for the class.
+///
+[ExcludeFromCodeCoverage]
+public class AlbumEntityFixture
+{
+ private readonly Random _random = new();
+ private readonly Faker _faker = new();
+ private readonly TrackEntityFixture _trackEntityFixture = new();
+ private readonly TagEntityFixture _tagEntityFixture = new();
+ private readonly GenreEntityFixture _genreEntityFixture = new();
+ private readonly AlbumContributorEntityFixture _albumContributorEntityFixture = new();
+ private readonly AudioRatingEntityFixture _audioRatingEntityFixture = new();
+
+ ///
+ /// Creates a random valid .
+ ///
+ /// Optional. The Id of the album.
+ /// Optional. The Id of the artist that owns the album.
+ /// Optional. The Id of the media library that owns the album.
+ /// Optional. The title of the album.
+ /// Optional. The tracks of the album.
+ /// Whether the album should own a generated track, or no track at all.
+ /// Whether the owned metadata collections (Tags, Genres, Contributors, Ratings) should be included, or forced to empty collections.
+ /// Optional. The original release date of the album.
+ /// Optional. The original release year of the album.
+ /// Optional. The re-release date of the album.
+ /// Optional. The re-release year of the album.
+ /// Optional. The barcode of the album.
+ /// Whether the original release date should be included, or forced to .
+ /// Whether the original release year should be included, or forced to .
+ /// Whether the re-release date should be included, or forced to .
+ /// Whether the re-release year should be included, or forced to .
+ /// Whether the barcode should be included, or forced to .
+ /// The created .
+ public AlbumEntity Create(
+ Guid? id = null,
+ Guid? artistId = null,
+ Guid? libraryId = null,
+ string? title = null,
+ List? tracks = null,
+ bool includeTracks = true,
+ bool includeMetadata = true,
+ DateOnly? originalReleaseDate = null,
+ int? originalReleaseYear = null,
+ DateOnly? reReleaseDate = null,
+ int? reReleaseYear = null,
+ string? barcode = null,
+ bool includeOriginalReleaseDate = true,
+ bool includeOriginalReleaseYear = true,
+ bool includeReReleaseDate = true,
+ bool includeReReleaseYear = true,
+ bool includeBarcode = true)
+ {
+ Guid resolvedId = id ?? Guid.NewGuid();
+ Guid resolvedArtistId = artistId ?? Guid.NewGuid();
+ Guid resolvedLibraryId = libraryId ?? Guid.NewGuid();
+ const int MAXIMUM_RELEASE_YEAR = 2026;
+ int resolvedOriginalReleaseYear = originalReleaseYear ?? _random.Next(1900, MAXIMUM_RELEASE_YEAR);
+ int resolvedReReleaseYearUpperBound = Math.Max(resolvedOriginalReleaseYear + 1, MAXIMUM_RELEASE_YEAR);
+ int resolvedReReleaseYear = reReleaseYear ?? _random.Next(resolvedOriginalReleaseYear, resolvedReReleaseYearUpperBound);
+ DateOnly resolvedOriginalReleaseDate = originalReleaseDate ?? _faker.DateOnlyBetween(new DateOnly(resolvedOriginalReleaseYear, 1, 1), new DateOnly(resolvedOriginalReleaseYear, 12, 31));
+ DateOnly resolvedReReleaseDate = reReleaseDate ?? _faker.DateOnlyBetween(resolvedReReleaseYear == resolvedOriginalReleaseYear ? resolvedOriginalReleaseDate : new DateOnly(resolvedReReleaseYear, 1, 1), new DateOnly(resolvedReReleaseYear, 12, 31));
+ List resolvedTracks = tracks ?? (includeTracks ? [_trackEntityFixture.Create(albumId: resolvedId, libraryId: resolvedLibraryId, includeMetadata: includeMetadata, includeOriginalReleaseDate: includeOriginalReleaseDate, includeOriginalReleaseYear: includeOriginalReleaseYear, includeReReleaseDate: includeReReleaseDate, includeReReleaseYear: includeReReleaseYear)] : []);
+
+ return new Faker()
+ .CustomInstantiator(f => new AlbumEntity
+ {
+ Id = resolvedId,
+ ArtistId = resolvedArtistId,
+ LibraryId = resolvedLibraryId,
+ Title = default!,
+ CreatedOnUtc = default,
+ CreatedBy = default,
+ UpdatedBy = null
+ })
+ .RuleFor(x => x.Title, f => title ?? f.Random.String2(f.Random.Number(1, 255)))
+ .RuleFor(x => x.OriginalTitle, f => f.Random.String2(f.Random.Number(1, 255)))
+ .RuleFor(x => x.Description, f => f.Random.String2(f.Random.Number(1, 2000)))
+ .RuleFor(x => x.OriginalReleaseDate, includeOriginalReleaseDate ? resolvedOriginalReleaseDate : (DateOnly?)null)
+ .RuleFor(x => x.OriginalReleaseYear, includeOriginalReleaseYear ? resolvedOriginalReleaseYear : (int?)null)
+ .RuleFor(x => x.ReReleaseDate, includeReReleaseDate ? resolvedReReleaseDate : (DateOnly?)null)
+ .RuleFor(x => x.ReReleaseYear, includeReReleaseYear ? resolvedReReleaseYear : (int?)null)
+ .RuleFor(x => x.ReleaseCountry, f => f.PickRandom())
+ .RuleFor(x => x.ReleaseVersion, f => f.Random.String2(f.Random.Number(1, 50)))
+ .RuleFor(x => x.LanguageCode, f => f.Random.String2(2))
+ .RuleFor(x => x.LanguageName, f => f.Random.String2(f.Random.Number(1, 50)))
+ .RuleFor(x => x.LanguageNativeName, f => f.Random.String2(f.Random.Number(1, 50)))
+ .RuleFor(x => x.OriginalLanguageCode, f => f.Random.String2(2))
+ .RuleFor(x => x.OriginalLanguageName, f => f.Random.String2(f.Random.Number(1, 50)))
+ .RuleFor(x => x.OriginalLanguageNativeName, f => f.Random.String2(f.Random.Number(1, 50)))
+ .RuleFor(x => x.ReleaseType, f => f.PickRandom())
+ .RuleFor(x => x.ReleaseStatus, f => f.PickRandom())
+ .RuleFor(x => x.TotalDiscs, _random.Next(1, 3))
+ .RuleFor(x => x.TotalTracks, resolvedTracks.Count)
+ .RuleFor(x => x.MediaFormat, f => f.PickRandom())
+ .RuleFor(x => x.Barcode, f => includeBarcode ? (barcode ?? f.Random.String2(f.Random.Number(12, 13), "0123456789")) : null)
+ .RuleFor(x => x.CatalogNumber, f => f.Random.String2(f.Random.Number(1, 50)))
+ .RuleFor(x => x.MusicBrainzReleaseId, f => f.Random.Guid())
+ .RuleFor(x => x.MusicBrainzReleaseGroupId, f => f.Random.Guid())
+ .RuleFor(x => x.MusicBrainzReleaseArtistId, f => f.Random.Guid())
+ .RuleFor(x => x.Tags, f => includeMetadata ? [.. _tagEntityFixture.CreateMany(f.Random.Number(1, 3))] : [])
+ .RuleFor(x => x.Genres, f => includeMetadata ? [.. _genreEntityFixture.CreateMany(f.Random.Number(1, 3))] : [])
+ .RuleFor(x => x.Contributors, f => includeMetadata ? _albumContributorEntityFixture.CreateMany(f.Random.Number(1, 3), albumId: resolvedId) : [])
+ .RuleFor(x => x.Ratings, f => includeMetadata ? _audioRatingEntityFixture.CreateMany(f.Random.Number(1, 3)) : [])
+ .RuleFor(x => x.Tracks, resolvedTracks)
+ .RuleFor(x => x.CreatedOnUtc, f => f.Date.Past())
+ .RuleFor(x => x.UpdatedOnUtc, f => f.Date.Recent())
+ .Generate();
+ }
+
+ ///
+ /// Creates a list of instances with randomized test data.
+ ///
+ /// Number of instances to create.
+ /// List of configured instances.
+ public List CreateMany(int count = 3)
+ {
+ return [.. Enumerable.Range(0, count).Select(_ => Create())];
+ }
+}
diff --git a/tests/Common/Lumina.Application.Fixtures/Common/DataAccess/Entities/MediaLibrary/AudioLibrary/MusicLibrary/ArtistContributorEntityFixture.cs b/tests/Common/Lumina.Application.Fixtures/Common/DataAccess/Entities/MediaLibrary/AudioLibrary/MusicLibrary/ArtistContributorEntityFixture.cs
new file mode 100644
index 00000000..33b55492
--- /dev/null
+++ b/tests/Common/Lumina.Application.Fixtures/Common/DataAccess/Entities/MediaLibrary/AudioLibrary/MusicLibrary/ArtistContributorEntityFixture.cs
@@ -0,0 +1,60 @@
+#region ========================================================================= USING =====================================================================================
+using Bogus;
+using Lumina.Application.Common.DataAccess.Entities.MediaLibrary.AudioLibrary.MusicLibrary;
+using Lumina.Domain.SharedKernel.Common.Enums.MediaContributors;
+using System;
+using System.Collections.Generic;
+using System.Diagnostics.CodeAnalysis;
+using System.Linq;
+#endregion
+
+namespace Lumina.Application.Fixtures.Common.DataAccess.Entities.MediaLibrary.AudioLibrary.MusicLibrary;
+
+///
+/// Fixture class for the class.
+///
+[ExcludeFromCodeCoverage]
+public class ArtistContributorEntityFixture
+{
+ private readonly Faker _faker = new();
+
+ ///
+ /// Creates a random valid .
+ ///
+ /// Optional. The Id of the participation.
+ /// Optional. The Id of the artist the contributor participated in.
+ /// Optional. The Id of the media contributor.
+ /// Optional. The role the contributor played in the artist.
+ /// Optional. The Id of the user that created the participation.
+ /// The created .
+ public ArtistContributorEntity Create(
+ Guid? id = null,
+ Guid? artistId = null,
+ Guid? mediaContributorId = null,
+ MediaContributorRole? role = null,
+ Guid? createdBy = null)
+ {
+ return new ArtistContributorEntity
+ {
+ Id = id ?? Guid.NewGuid(),
+ ArtistId = artistId ?? Guid.NewGuid(),
+ MediaContributorId = mediaContributorId ?? Guid.NewGuid(),
+ Role = role ?? _faker.PickRandom(),
+ CreatedOnUtc = _faker.Date.Past(),
+ CreatedBy = createdBy ?? Guid.NewGuid(),
+ UpdatedOnUtc = _faker.Random.Bool() ? _faker.Date.Recent() : null,
+ UpdatedBy = _faker.Random.Bool() ? Guid.NewGuid() : null
+ };
+ }
+
+ ///
+ /// Creates a list of instances with randomized test data.
+ ///
+ /// Number of instances to create.
+ /// Optional. The Id of the artist the contributors participated in.
+ /// List of configured instances.
+ public List CreateMany(int count = 3, Guid? artistId = null)
+ {
+ return [.. Enumerable.Range(0, count).Select(_ => Create(artistId: artistId))];
+ }
+}
diff --git a/tests/Common/Lumina.Application.Fixtures/Common/DataAccess/Entities/MediaLibrary/AudioLibrary/MusicLibrary/ArtistEntityFixture.cs b/tests/Common/Lumina.Application.Fixtures/Common/DataAccess/Entities/MediaLibrary/AudioLibrary/MusicLibrary/ArtistEntityFixture.cs
new file mode 100644
index 00000000..fc730f78
--- /dev/null
+++ b/tests/Common/Lumina.Application.Fixtures/Common/DataAccess/Entities/MediaLibrary/AudioLibrary/MusicLibrary/ArtistEntityFixture.cs
@@ -0,0 +1,74 @@
+#region ========================================================================= USING =====================================================================================
+using Bogus;
+using Lumina.Application.Common.DataAccess.Entities.MediaLibrary.AudioLibrary.MusicLibrary;
+using System;
+using System.Collections.Generic;
+using System.Diagnostics.CodeAnalysis;
+using System.Linq;
+#endregion
+
+namespace Lumina.Application.Fixtures.Common.DataAccess.Entities.MediaLibrary.AudioLibrary.MusicLibrary;
+
+///
+/// Fixture class for the class.
+///
+[ExcludeFromCodeCoverage]
+public class ArtistEntityFixture
+{
+ private readonly AlbumEntityFixture _albumEntityFixture = new();
+ private readonly ArtistContributorEntityFixture _artistContributorEntityFixture = new();
+
+ ///
+ /// Creates a random valid .
+ ///
+ /// Optional. The Id of the artist.
+ /// Optional. The Id of the media library that owns the artist.
+ /// Optional. The name of the artist.
+ /// Optional. The albums of the artist.
+ /// Whether the artist should own a generated album, or no album at all.
+ /// Whether the artist should own a generated media contributor, or none at all.
+ /// Whether the owned metadata collections of the generated album should be included, or forced to empty collections.
+ /// The created .
+ public ArtistEntity Create(
+ Guid? id = null,
+ Guid? libraryId = null,
+ string? name = null,
+ List? albums = null,
+ bool includeAlbums = true,
+ bool includeContributors = true,
+ bool includeMetadata = true)
+ {
+ Guid resolvedId = id ?? Guid.NewGuid();
+ Guid resolvedLibraryId = libraryId ?? Guid.NewGuid();
+ List resolvedAlbums = albums ?? (includeAlbums ? [_albumEntityFixture.Create(artistId: resolvedId, libraryId: resolvedLibraryId, includeMetadata: includeMetadata)] : []);
+
+ return new Faker()
+ .CustomInstantiator(f => new ArtistEntity
+ {
+ Id = resolvedId,
+ LibraryId = resolvedLibraryId,
+ Name = default!,
+ CreatedOnUtc = default,
+ CreatedBy = default,
+ UpdatedBy = null
+ })
+ .RuleFor(x => x.Name, f => name ?? f.Name.FullName())
+ .RuleFor(x => x.Website, f => f.Internet.Url())
+ .RuleFor(x => x.MusicBrainzArtistId, f => f.Random.Guid())
+ .RuleFor(x => x.Albums, resolvedAlbums)
+ .RuleFor(x => x.Contributors, f => includeContributors ? _artistContributorEntityFixture.CreateMany(f.Random.Number(1, 3), artistId: resolvedId) : [])
+ .RuleFor(x => x.CreatedOnUtc, f => f.Date.Past())
+ .RuleFor(x => x.UpdatedOnUtc, f => f.Date.Recent())
+ .Generate();
+ }
+
+ ///
+ /// Creates a list of instances with randomized test data.
+ ///
+ /// Number of instances to create.
+ /// List of configured instances.
+ public List CreateMany(int count = 3)
+ {
+ return [.. Enumerable.Range(0, count).Select(_ => Create())];
+ }
+}
diff --git a/tests/Common/Lumina.Application.Fixtures/Common/DataAccess/Entities/MediaLibrary/AudioLibrary/MusicLibrary/AudioRatingEntityFixture.cs b/tests/Common/Lumina.Application.Fixtures/Common/DataAccess/Entities/MediaLibrary/AudioLibrary/MusicLibrary/AudioRatingEntityFixture.cs
new file mode 100644
index 00000000..9d04a636
--- /dev/null
+++ b/tests/Common/Lumina.Application.Fixtures/Common/DataAccess/Entities/MediaLibrary/AudioLibrary/MusicLibrary/AudioRatingEntityFixture.cs
@@ -0,0 +1,59 @@
+#region ========================================================================= USING =====================================================================================
+using Bogus;
+using Lumina.Application.Common.DataAccess.Entities.MediaLibrary.AudioLibrary.MusicLibrary;
+using Lumina.Domain.SharedKernel.Common.Enums.AudioLibrary;
+using System.Collections.Generic;
+using System.Diagnostics.CodeAnalysis;
+using System.Linq;
+#endregion
+
+namespace Lumina.Application.Fixtures.Common.DataAccess.Entities.MediaLibrary.AudioLibrary.MusicLibrary;
+
+///
+/// Fixture class for the record.
+///
+[ExcludeFromCodeCoverage]
+public class AudioRatingEntityFixture
+{
+ private readonly Faker _faker = new();
+
+ ///
+ /// Creates a random valid .
+ ///
+ /// Optional. The rating value of the audio media element.
+ /// Optional. The maximum possible rating value of the audio media element.
+ /// Optional. The source of the audio rating.
+ /// Optional. The number of votes that contributed to the audio rating.
+ /// Whether the value should be included, or forced to .
+ /// Whether the maximum value should be included, or forced to .
+ /// Whether the source should be included, or forced to .
+ /// Whether the vote count should be included, or forced to .
+ /// The created .
+ public AudioRatingEntity Create(
+ decimal? value = null,
+ decimal? maxValue = null,
+ AudioRatingSource? source = null,
+ int? voteCount = null,
+ bool includeValue = true,
+ bool includeMaxValue = true,
+ bool includeSource = true,
+ bool includeVoteCount = true)
+ {
+ return new AudioRatingEntity(
+ includeValue ? (value ?? _faker.Random.Decimal(1, 5)) : null,
+ includeMaxValue ? (maxValue ?? 5) : null,
+ includeSource ? (source ?? _faker.PickRandom()) : null,
+ includeVoteCount ? (voteCount ?? _faker.Random.Number(1, 1000)) : null
+ );
+ }
+
+ ///
+ /// Creates a list of .
+ ///
+ /// The number of elements to create.
+ /// The created list.
+ public List CreateMany(int count = 3)
+ {
+ return [.. Enumerable.Range(0, count).Select(_ => Create())];
+ }
+}
diff --git a/tests/Common/Lumina.Application.Fixtures/Common/DataAccess/Entities/MediaLibrary/AudioLibrary/MusicLibrary/TrackContributorEntityFixture.cs b/tests/Common/Lumina.Application.Fixtures/Common/DataAccess/Entities/MediaLibrary/AudioLibrary/MusicLibrary/TrackContributorEntityFixture.cs
new file mode 100644
index 00000000..3a1030e2
--- /dev/null
+++ b/tests/Common/Lumina.Application.Fixtures/Common/DataAccess/Entities/MediaLibrary/AudioLibrary/MusicLibrary/TrackContributorEntityFixture.cs
@@ -0,0 +1,60 @@
+#region ========================================================================= USING =====================================================================================
+using Bogus;
+using Lumina.Application.Common.DataAccess.Entities.MediaLibrary.AudioLibrary.MusicLibrary;
+using Lumina.Domain.SharedKernel.Common.Enums.MediaContributors;
+using System;
+using System.Collections.Generic;
+using System.Diagnostics.CodeAnalysis;
+using System.Linq;
+#endregion
+
+namespace Lumina.Application.Fixtures.Common.DataAccess.Entities.MediaLibrary.AudioLibrary.MusicLibrary;
+
+///
+/// Fixture class for the class.
+///
+[ExcludeFromCodeCoverage]
+public class TrackContributorEntityFixture
+{
+ private readonly Faker _faker = new();
+
+ ///
+ /// Creates a random valid .
+ ///
+ /// Optional. The Id of the participation.
+ /// Optional. The Id of the track the contributor participated in.
+ /// Optional. The Id of the media contributor.
+ /// Optional. The role the contributor played in the track.
+ /// Optional. The Id of the user that created the participation.
+ /// The created .
+ public TrackContributorEntity Create(
+ Guid? id = null,
+ Guid? trackId = null,
+ Guid? mediaContributorId = null,
+ MediaContributorRole? role = null,
+ Guid? createdBy = null)
+ {
+ return new TrackContributorEntity
+ {
+ Id = id ?? Guid.NewGuid(),
+ TrackId = trackId ?? Guid.NewGuid(),
+ MediaContributorId = mediaContributorId ?? Guid.NewGuid(),
+ Role = role ?? _faker.PickRandom(),
+ CreatedOnUtc = _faker.Date.Past(),
+ CreatedBy = createdBy ?? Guid.NewGuid(),
+ UpdatedOnUtc = _faker.Random.Bool() ? _faker.Date.Recent() : null,
+ UpdatedBy = _faker.Random.Bool() ? Guid.NewGuid() : null
+ };
+ }
+
+ ///
+ /// Creates a list of instances with randomized test data.
+ ///
+ /// Number of instances to create.
+ /// Optional. The Id of the track the contributors participated in.
+ /// List of configured instances.
+ public List CreateMany(int count = 3, Guid? trackId = null)
+ {
+ return [.. Enumerable.Range(0, count).Select(_ => Create(trackId: trackId))];
+ }
+}
diff --git a/tests/Common/Lumina.Application.Fixtures/Common/DataAccess/Entities/MediaLibrary/AudioLibrary/MusicLibrary/TrackEntityFixture.cs b/tests/Common/Lumina.Application.Fixtures/Common/DataAccess/Entities/MediaLibrary/AudioLibrary/MusicLibrary/TrackEntityFixture.cs
new file mode 100644
index 00000000..ea928114
--- /dev/null
+++ b/tests/Common/Lumina.Application.Fixtures/Common/DataAccess/Entities/MediaLibrary/AudioLibrary/MusicLibrary/TrackEntityFixture.cs
@@ -0,0 +1,141 @@
+#region ========================================================================= USING =====================================================================================
+using Bogus;
+using Lumina.Application.Common.DataAccess.Entities.Common;
+using Lumina.Application.Common.DataAccess.Entities.MediaLibrary.AudioLibrary.MusicLibrary;
+using Lumina.Application.Fixtures.Common.DataAccess.Entities.Common;
+using Lumina.Application.Fixtures.Common.Setup;
+using Lumina.Domain.SharedKernel.Common.Enums.AudioLibrary;
+using Lumina.Domain.SharedKernel.Common.Enums.Common;
+using System;
+using System.Collections.Generic;
+using System.Diagnostics.CodeAnalysis;
+using System.Linq;
+#endregion
+
+namespace Lumina.Application.Fixtures.Common.DataAccess.Entities.MediaLibrary.AudioLibrary.MusicLibrary;
+
+///
+/// Fixture class for the class.
+///
+[ExcludeFromCodeCoverage]
+public class TrackEntityFixture
+{
+ private readonly Random _random = new();
+ private readonly Faker _faker = new();
+ private readonly TagEntityFixture _tagEntityFixture = new();
+ private readonly GenreEntityFixture _genreEntityFixture = new();
+ private readonly TrackMoodEntityFixture _trackMoodEntityFixture = new();
+ private readonly TrackIsrcEntityFixture _trackIsrcEntityFixture = new();
+ private readonly TrackContributorEntityFixture _trackContributorEntityFixture = new();
+ private readonly AudioRatingEntityFixture _audioRatingEntityFixture = new();
+
+ ///
+ /// Creates a random valid .
+ ///
+ /// Optional. The Id of the track.
+ /// Optional. The Id of the album that owns the track.
+ /// Optional. The Id of the media library that owns the track.
+ /// Optional. The file system path of the track.
+ /// Optional. The title of the track.
+ /// Optional. The number of the track on its disc.
+ /// Whether the owned metadata collections (Tags, Genres, Moods, ISRCs, Contributors, Ratings) should be included, or forced to empty collections.
+ /// Optional. The original release date of the track.
+ /// Optional. The original release year of the track.
+ /// Optional. The re-release date of the track.
+ /// Optional. The re-release year of the track.
+ /// Whether the original release date should be included, or forced to .
+ /// Whether the original release year should be included, or forced to .
+ /// Whether the re-release date should be included, or forced to .
+ /// Whether the re-release year should be included, or forced to .
+ /// The created .
+ public TrackEntity Create(
+ Guid? id = null,
+ Guid? albumId = null,
+ Guid? libraryId = null,
+ string? path = null,
+ string? title = null,
+ int? trackNumber = null,
+ bool includeMetadata = true,
+ DateOnly? originalReleaseDate = null,
+ int? originalReleaseYear = null,
+ DateOnly? reReleaseDate = null,
+ int? reReleaseYear = null,
+ bool includeOriginalReleaseDate = true,
+ bool includeOriginalReleaseYear = true,
+ bool includeReReleaseDate = true,
+ bool includeReReleaseYear = true)
+ {
+ Guid resolvedId = id ?? Guid.NewGuid();
+ Guid resolvedAlbumId = albumId ?? Guid.NewGuid();
+ Guid resolvedLibraryId = libraryId ?? Guid.NewGuid();
+ const int MAXIMUM_RELEASE_YEAR = 2026;
+ int resolvedOriginalReleaseYear = originalReleaseYear ?? _random.Next(1900, MAXIMUM_RELEASE_YEAR);
+ int resolvedReReleaseYearUpperBound = Math.Max(resolvedOriginalReleaseYear + 1, MAXIMUM_RELEASE_YEAR);
+ int resolvedReReleaseYear = reReleaseYear ?? _random.Next(resolvedOriginalReleaseYear, resolvedReReleaseYearUpperBound);
+ DateOnly resolvedOriginalReleaseDate = originalReleaseDate ?? _faker.DateOnlyBetween(new DateOnly(resolvedOriginalReleaseYear, 1, 1), new DateOnly(resolvedOriginalReleaseYear, 12, 31));
+ DateOnly resolvedReReleaseDate = reReleaseDate ?? _faker.DateOnlyBetween(resolvedReReleaseYear == resolvedOriginalReleaseYear ? resolvedOriginalReleaseDate : new DateOnly(resolvedReReleaseYear, 1, 1), new DateOnly(resolvedReReleaseYear, 12, 31));
+
+ return new Faker()
+ .CustomInstantiator(f => new TrackEntity
+ {
+ Id = resolvedId,
+ AlbumId = resolvedAlbumId,
+ LibraryId = resolvedLibraryId,
+ Path = default!,
+ Title = default!,
+ CreatedOnUtc = default,
+ CreatedBy = default,
+ UpdatedBy = null
+ })
+ .RuleFor(x => x.Path, f => path ?? f.System.FilePath())
+ .RuleFor(x => x.Title, f => title ?? f.Random.String2(f.Random.Number(1, 255)))
+ .RuleFor(x => x.OriginalTitle, f => f.Random.String2(f.Random.Number(1, 255)))
+ .RuleFor(x => x.Description, f => f.Random.String2(f.Random.Number(1, 2000)))
+ .RuleFor(x => x.OriginalReleaseDate, includeOriginalReleaseDate ? resolvedOriginalReleaseDate : null)
+ .RuleFor(x => x.OriginalReleaseYear, includeOriginalReleaseYear ? resolvedOriginalReleaseYear : null)
+ .RuleFor(x => x.ReReleaseDate, includeReReleaseDate ? resolvedReReleaseDate : null)
+ .RuleFor(x => x.ReReleaseYear, includeReReleaseYear ? resolvedReReleaseYear : null)
+ .RuleFor(x => x.ReleaseCountry, f => f.PickRandom())
+ .RuleFor(x => x.ReleaseVersion, f => f.Random.String2(f.Random.Number(1, 50)))
+ .RuleFor(x => x.LanguageCode, f => f.Random.String2(2))
+ .RuleFor(x => x.LanguageName, f => f.Random.String2(f.Random.Number(1, 50)))
+ .RuleFor(x => x.LanguageNativeName, f => f.Random.String2(f.Random.Number(1, 50)))
+ .RuleFor(x => x.OriginalLanguageCode, f => f.Random.String2(2))
+ .RuleFor(x => x.OriginalLanguageName, f => f.Random.String2(f.Random.Number(1, 50)))
+ .RuleFor(x => x.OriginalLanguageNativeName, f => f.Random.String2(f.Random.Number(1, 50)))
+ .RuleFor(x => x.DurationInSeconds, _random.Next(60, 7200))
+ .RuleFor(x => x.SampleRate, f => f.PickRandom(44100, 48000, 96000))
+ .RuleFor(x => x.Channels, f => f.PickRandom(1, 2, 6))
+ .RuleFor(x => x.BitDepth, _random.Next(8, 32))
+ .RuleFor(x => x.AudioCodec, f => f.PickRandom("FLAC", "MP3", "AAC", "ALAC"))
+ .RuleFor(x => x.Bitrate, _random.Next(96, 1411))
+ .RuleFor(x => x.TrackNumber, f => trackNumber ?? f.Random.Int(1, 20))
+ .RuleFor(x => x.DiscNumber, _random.Next(1, 3))
+ .RuleFor(x => x.Script, f => f.Random.String2(f.Random.Number(1, 50)))
+ .RuleFor(x => x.Key, f => f.PickRandom())
+ .RuleFor(x => x.Bpm, _random.Next(40, 240))
+ .RuleFor(x => x.Work, f => f.Music.Genre())
+ .RuleFor(x => x.MusicBrainzRecordingId, f => f.Random.Guid())
+ .RuleFor(x => x.MusicBrainzTrackId, f => f.Random.Guid())
+ .RuleFor(x => x.MusicBrainzWorkId, f => f.Random.Guid())
+ .RuleFor(x => x.Tags, f => includeMetadata ? [.. _tagEntityFixture.CreateMany(f.Random.Number(1, 3))] : [])
+ .RuleFor(x => x.Genres, f => includeMetadata ? [.. _genreEntityFixture.CreateMany(f.Random.Number(1, 3))] : [])
+ .RuleFor(x => x.Moods, f => includeMetadata ? _trackMoodEntityFixture.CreateMany(f.Random.Number(1, 3)) : [])
+ .RuleFor(x => x.Isrcs, f => includeMetadata ? _trackIsrcEntityFixture.CreateMany(f.Random.Number(1, 3)) : [])
+ .RuleFor(x => x.Contributors, f => includeMetadata ? _trackContributorEntityFixture.CreateMany(f.Random.Number(1, 3), trackId: resolvedId) : [])
+ .RuleFor(x => x.Ratings, f => includeMetadata ? _audioRatingEntityFixture.CreateMany(f.Random.Number(1, 3)) : [])
+ .RuleFor(x => x.CreatedOnUtc, f => f.Date.Past())
+ .RuleFor(x => x.UpdatedOnUtc, f => f.Date.Recent())
+ .Generate();
+ }
+
+ ///
+ /// Creates a list of instances with randomized test data.
+ ///
+ /// Number of instances to create.
+ /// List of configured instances.
+ public List CreateMany(int count = 3)
+ {
+ return [.. Enumerable.Range(0, count).Select(_ => Create())];
+ }
+}
diff --git a/tests/Common/Lumina.Application.Fixtures/Common/DataAccess/Entities/MediaLibrary/AudioLibrary/MusicLibrary/TrackIsrcEntityFixture.cs b/tests/Common/Lumina.Application.Fixtures/Common/DataAccess/Entities/MediaLibrary/AudioLibrary/MusicLibrary/TrackIsrcEntityFixture.cs
new file mode 100644
index 00000000..df274af2
--- /dev/null
+++ b/tests/Common/Lumina.Application.Fixtures/Common/DataAccess/Entities/MediaLibrary/AudioLibrary/MusicLibrary/TrackIsrcEntityFixture.cs
@@ -0,0 +1,46 @@
+#region ========================================================================= USING =====================================================================================
+using Bogus;
+using Lumina.Application.Common.DataAccess.Entities.MediaLibrary.AudioLibrary.MusicLibrary;
+using System.Collections.Generic;
+using System.Diagnostics.CodeAnalysis;
+using System.Linq;
+#endregion
+
+namespace Lumina.Application.Fixtures.Common.DataAccess.Entities.MediaLibrary.AudioLibrary.MusicLibrary;
+
+///
+/// Fixture class for the record.
+///
+[ExcludeFromCodeCoverage]
+public class TrackIsrcEntityFixture
+{
+ private const string LETTERS = "ABCDEFGHIJKLMNOPQRSTUVWXYZ";
+ private const string ALPHANUMERICS = "ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789";
+ private const string DIGITS = "0123456789";
+
+ private readonly Faker _faker = new();
+
+ ///
+ /// Creates a random valid .
+ ///
+ /// Optional. The value of the ISRC.
+ /// The created .
+ public TrackIsrcEntity Create(string? value = null)
+ {
+ // ISRC codes follow the domain format: two letters, three alphanumeric characters and seven digits.
+ return new TrackIsrcEntity(value ?? (
+ _faker.Random.String2(2, LETTERS)
+ + _faker.Random.String2(3, ALPHANUMERICS)
+ + _faker.Random.String2(7, DIGITS)));
+ }
+
+ ///
+ /// Creates a list of .
+ ///
+ /// The number of elements to create.
+ /// The created list.
+ public List CreateMany(int count = 3)
+ {
+ return [.. Enumerable.Range(0, count).Select(_ => Create())];
+ }
+}
diff --git a/tests/Common/Lumina.Application.Fixtures/Common/DataAccess/Entities/MediaLibrary/AudioLibrary/MusicLibrary/TrackMoodEntityFixture.cs b/tests/Common/Lumina.Application.Fixtures/Common/DataAccess/Entities/MediaLibrary/AudioLibrary/MusicLibrary/TrackMoodEntityFixture.cs
new file mode 100644
index 00000000..02103714
--- /dev/null
+++ b/tests/Common/Lumina.Application.Fixtures/Common/DataAccess/Entities/MediaLibrary/AudioLibrary/MusicLibrary/TrackMoodEntityFixture.cs
@@ -0,0 +1,39 @@
+#region ========================================================================= USING =====================================================================================
+using Bogus;
+using Lumina.Application.Common.DataAccess.Entities.MediaLibrary.AudioLibrary.MusicLibrary;
+using System.Collections.Generic;
+using System.Diagnostics.CodeAnalysis;
+using System.Linq;
+#endregion
+
+namespace Lumina.Application.Fixtures.Common.DataAccess.Entities.MediaLibrary.AudioLibrary.MusicLibrary;
+
+///
+/// Fixture class for the record.
+///
+[ExcludeFromCodeCoverage]
+public class TrackMoodEntityFixture
+{
+ private readonly Faker _faker = new();
+
+ ///
+ /// Creates a random valid .
+ ///
+ /// Optional. The name of the mood.
+ /// The created .
+ public TrackMoodEntity Create(
+ string? name = null)
+ {
+ return new TrackMoodEntity(name ?? _faker.Lorem.Word());
+ }
+
+ ///
+ /// Creates a list of .
+ ///
+ /// The number of elements to create.
+ /// The created list.
+ public List CreateMany(int count = 3)
+ {
+ return [.. Enumerable.Range(0, count).Select(_ => Create())];
+ }
+}
diff --git a/tests/Common/Lumina.Application.Fixtures/Core/MediaLibrary/AudioLibrary/MusicLibrary/Tracks/Commands/AddTrack/AddTrackCommandFixture.cs b/tests/Common/Lumina.Application.Fixtures/Core/MediaLibrary/AudioLibrary/MusicLibrary/Tracks/Commands/AddTrack/AddTrackCommandFixture.cs
new file mode 100644
index 00000000..038fc6e7
--- /dev/null
+++ b/tests/Common/Lumina.Application.Fixtures/Core/MediaLibrary/AudioLibrary/MusicLibrary/Tracks/Commands/AddTrack/AddTrackCommandFixture.cs
@@ -0,0 +1,128 @@
+#region ========================================================================= USING =====================================================================================
+using Bogus;
+using Lumina.Application.Core.MediaLibrary.AudioLibrary.MusicLibrary.Tracks.Commands.AddTrack;
+using Lumina.Contracts.DTO.Common;
+using Lumina.Contracts.DTO.MediaContributors;
+using Lumina.Contracts.DTO.MediaLibrary.AudioLibrary;
+using Lumina.Contracts.DTO.MediaLibrary.AudioLibrary.MusicLibrary;
+using Lumina.Contracts.Fixtures.Core.DTO.Common;
+using Lumina.Contracts.Fixtures.Core.DTO.MediaContributors;
+using Lumina.Contracts.Fixtures.Core.DTO.MediaLibrary.AudioLibrary;
+using Lumina.Contracts.Fixtures.Core.DTO.MediaLibrary.AudioLibrary.MusicLibrary;
+using Lumina.Domain.SharedKernel.Common.Enums.AudioLibrary;
+using System;
+using System.Collections.Generic;
+using System.Diagnostics.CodeAnalysis;
+using System.IO;
+using System.Linq;
+#endregion
+
+namespace Lumina.Application.Fixtures.Core.MediaLibrary.AudioLibrary.MusicLibrary.Tracks.Commands.AddTrack;
+
+///
+/// Fixture class for the class.
+///
+[ExcludeFromCodeCoverage]
+public class AddTrackCommandFixture
+{
+ private readonly Faker _faker = new();
+ private readonly AudioMetadataDtoFixture _audioMetadataDtoFixture = new();
+ private readonly MoodDtoFixture _moodDtoFixture = new();
+ private readonly IsrcDtoFixture _isrcDtoFixture = new();
+ private readonly MediaContributorReferenceDtoFixture _mediaContributorReferenceDtoFixture = new();
+ private readonly AudioRatingDtoFixture _audioRatingDtoFixture = new();
+
+ ///
+ /// Creates a random valid command to add a track.
+ ///
+ /// Optional. The Id of the media library the track belongs to, taken from the route.
+ /// Optional. The Id of the artist the track belongs to, taken from the route.
+ /// Optional. The Id of the album the track belongs to, taken from the route.
+ /// Optional. The file system path of the track.
+ /// Optional. The audio metadata of the track.
+ /// Optional. The number of the track on its disc.
+ /// Optional. The number of the disc the track belongs to.
+ /// Optional. The script used by the language of the track.
+ /// Optional. The musical key of the track.
+ /// Optional. The tempo of the track in beats per minute.
+ /// Optional. The title of the work the track is a recording of.
+ /// Optional. The MusicBrainz identifier of the recording.
+ /// Optional. The MusicBrainz identifier of the track.
+ /// Optional. The MusicBrainz identifier of the work.
+ /// Optional. The list of moods of the track.
+ /// Optional. The list of ISRC of the track.
+ /// Optional. The list of media contributors that performed on the track.
+ /// Optional. The list of ratings for this track.
+ /// Optional. The Id of the track, when it already exists.
+ /// Whether the library Id should be included, or forced to .
+ /// Whether the artist Id should be included, or forced to .
+ /// Whether the album Id should be included, or forced to .
+ /// Whether the path should be included, or forced to .
+ /// Whether the metadata should be included, or forced to .
+ /// Whether the track number should be included, or forced to .
+ /// Whether the properties that are not explicitly provided should be randomized, or forced to .
+ /// Whether the contributors should be included, or forced to .
+ /// Whether the ratings should be included, or forced to .
+ /// The created command to add a track.
+ public AddTrackCommand Create(
+ string? libraryId = null,
+ string? artistId = null,
+ string? albumId = null,
+ string? path = null,
+ AudioMetadataDto? metadata = null,
+ int? trackNumber = null,
+ int? discNumber = null,
+ string? script = null,
+ MusicKey? key = null,
+ int? bpm = null,
+ string? work = null,
+ Guid? musicBrainzRecordingId = null,
+ Guid? musicBrainzTrackId = null,
+ Guid? musicBrainzWorkId = null,
+ List? moods = null,
+ List? isrcs = null,
+ List? contributors = null,
+ List? ratings = null,
+ Guid? trackId = null,
+ bool includeLibraryId = true,
+ bool includeArtistId = true,
+ bool includeAlbumId = true,
+ bool includePath = true,
+ bool includeMetadata = true,
+ bool includeTrackNumber = true,
+ bool includeOptionalProperties = true,
+ bool includeContributors = true,
+ bool includeRatings = true)
+ {
+ return new AddTrackCommand(
+ includeLibraryId ? libraryId ?? Guid.NewGuid().ToString() : null,
+ includeArtistId ? artistId ?? Guid.NewGuid().ToString() : null,
+ includeAlbumId ? albumId ?? Guid.NewGuid().ToString() : null,
+ 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() : 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,
+ includeContributors ? contributors ?? _mediaContributorReferenceDtoFixture.CreateMany(_faker.Random.Int(1, 3)) : null,
+ includeRatings ? ratings ?? _audioRatingDtoFixture.CreateMany(_faker.Random.Int(1, 3)) : null,
+ trackId);
+ }
+
+ ///
+ /// Creates a list of .
+ ///
+ /// The number of elements to create.
+ /// The created list.
+ public List CreateMany(int count = 3)
+ {
+ return [.. Enumerable.Range(0, count).Select(_ => Create())];
+ }
+}
diff --git a/tests/Common/Lumina.Application.Fixtures/Core/MediaLibrary/AudioLibrary/MusicLibrary/Tracks/Commands/DeleteTrack/DeleteTrackCommandFixture.cs b/tests/Common/Lumina.Application.Fixtures/Core/MediaLibrary/AudioLibrary/MusicLibrary/Tracks/Commands/DeleteTrack/DeleteTrackCommandFixture.cs
new file mode 100644
index 00000000..847137a9
--- /dev/null
+++ b/tests/Common/Lumina.Application.Fixtures/Core/MediaLibrary/AudioLibrary/MusicLibrary/Tracks/Commands/DeleteTrack/DeleteTrackCommandFixture.cs
@@ -0,0 +1,55 @@
+#region ========================================================================= USING =====================================================================================
+using Lumina.Application.Core.MediaLibrary.AudioLibrary.MusicLibrary.Tracks.Commands.DeleteTrack;
+using System;
+using System.Collections.Generic;
+using System.Diagnostics.CodeAnalysis;
+using System.Linq;
+#endregion
+
+namespace Lumina.Application.Fixtures.Core.MediaLibrary.AudioLibrary.MusicLibrary.Tracks.Commands.DeleteTrack;
+
+///
+/// Fixture class for the class.
+///
+[ExcludeFromCodeCoverage]
+public class DeleteTrackCommandFixture
+{
+ ///
+ /// Creates a random valid .
+ ///
+ /// Optional. The Id of the media library the track belongs to.
+ /// Optional. The Id of the artist the album of the track belongs to.
+ /// Optional. The Id of the album the track belongs to.
+ /// Optional. The Id of the track to delete.
+ /// Whether the library Id should be included, or forced to .
+ /// Whether the artist Id should be included, or forced to .
+ /// Whether the album Id should be included, or forced to .
+ /// Whether the track Id should be included, or forced to .
+ /// The created .
+ public DeleteTrackCommand Create(
+ string? libraryId = null,
+ string? artistId = null,
+ string? albumId = null,
+ string? trackId = null,
+ bool includeLibraryId = true,
+ bool includeArtistId = true,
+ bool includeAlbumId = true,
+ bool includeTrackId = true)
+ {
+ return new DeleteTrackCommand(
+ includeLibraryId ? (libraryId ?? Guid.NewGuid().ToString()) : null,
+ includeArtistId ? (artistId ?? Guid.NewGuid().ToString()) : null,
+ includeAlbumId ? (albumId ?? Guid.NewGuid().ToString()) : null,
+ includeTrackId ? (trackId ?? Guid.NewGuid().ToString()) : null);
+ }
+
+ ///
+ /// Creates a list of instances with randomized test data.
+ ///
+ /// The number of elements to create.
+ /// The created list.
+ public List CreateMany(int count = 3)
+ {
+ return [.. Enumerable.Range(0, count).Select(_ => Create())];
+ }
+}
diff --git a/tests/Common/Lumina.Application.Fixtures/Core/MediaLibrary/AudioLibrary/MusicLibrary/Tracks/Commands/UpdateTrack/UpdateTrackCommandFixture.cs b/tests/Common/Lumina.Application.Fixtures/Core/MediaLibrary/AudioLibrary/MusicLibrary/Tracks/Commands/UpdateTrack/UpdateTrackCommandFixture.cs
new file mode 100644
index 00000000..284e3b1b
--- /dev/null
+++ b/tests/Common/Lumina.Application.Fixtures/Core/MediaLibrary/AudioLibrary/MusicLibrary/Tracks/Commands/UpdateTrack/UpdateTrackCommandFixture.cs
@@ -0,0 +1,129 @@
+#region ========================================================================= USING =====================================================================================
+using Bogus;
+using Lumina.Application.Core.MediaLibrary.AudioLibrary.MusicLibrary.Tracks.Commands.UpdateTrack;
+using Lumina.Contracts.DTO.Common;
+using Lumina.Contracts.DTO.MediaContributors;
+using Lumina.Contracts.DTO.MediaLibrary.AudioLibrary;
+using Lumina.Contracts.DTO.MediaLibrary.AudioLibrary.MusicLibrary;
+using Lumina.Contracts.Fixtures.Core.DTO.Common;
+using Lumina.Contracts.Fixtures.Core.DTO.MediaContributors;
+using Lumina.Contracts.Fixtures.Core.DTO.MediaLibrary.AudioLibrary;
+using Lumina.Contracts.Fixtures.Core.DTO.MediaLibrary.AudioLibrary.MusicLibrary;
+using Lumina.Domain.SharedKernel.Common.Enums.AudioLibrary;
+using System;
+using System.Collections.Generic;
+using System.Diagnostics.CodeAnalysis;
+using System.Linq;
+#endregion
+
+namespace Lumina.Application.Fixtures.Core.MediaLibrary.AudioLibrary.MusicLibrary.Tracks.Commands.UpdateTrack;
+
+///
+/// Fixture class for the record.
+///
+[ExcludeFromCodeCoverage]
+public class UpdateTrackCommandFixture
+{
+ private readonly Faker _faker = new();
+ private readonly AudioMetadataDtoFixture _audioMetadataDtoFixture = new();
+ private readonly MoodDtoFixture _moodDtoFixture = new();
+ private readonly IsrcDtoFixture _isrcDtoFixture = new();
+ private readonly MediaContributorReferenceDtoFixture _mediaContributorReferenceDtoFixture = new();
+ private readonly AudioRatingDtoFixture _audioRatingDtoFixture = new();
+
+ ///
+ /// Creates a random valid command to update a track.
+ ///
+ /// Optional. The Id of the media library the track belongs to.
+ /// Optional. The Id of the artist the track belongs to.
+ /// Optional. The Id of the album the track belongs to.
+ /// Optional. The Id of the track to update.
+ /// Optional. The file system path of the track.
+ /// Optional. The audio metadata of the track.
+ /// Optional. The number of the track on its disc.
+ /// Optional. The number of the disc the track belongs to.
+ /// Optional. The script used by the language of the track.
+ /// Optional. The musical key of the track.
+ /// Optional. The tempo of the track in beats per minute.
+ /// Optional. The title of the work the track is a recording of.
+ /// Optional. The MusicBrainz identifier of the recording.
+ /// Optional. The MusicBrainz identifier of the track.
+ /// Optional. The MusicBrainz identifier of the work.
+ /// Optional. The moods of the track.
+ /// Optional. The ISRC codes of the track.
+ /// Optional. The media contributors that performed on the track.
+ /// Optional. The ratings of the track.
+ /// Whether the optional properties that are not explicitly provided should be randomized, or forced to .
+ /// Whether the metadata should be included, or forced to .
+ /// Whether the contributors list should be included, or forced to .
+ /// Whether the ratings list should be included, or forced to .
+ /// Whether the library Id should be included, or forced to .
+ /// Whether the artist Id should be included, or forced to .
+ /// Whether the album Id should be included, or forced to .
+ /// Whether the track Id should be included, or forced to .
+ /// Whether the path should be included, or forced to .
+ /// Whether the track number should be included, or forced to .
+ /// The created command to update a track.
+ public UpdateTrackCommand Create(
+ string? libraryId = null,
+ string? artistId = null,
+ string? albumId = null,
+ string? trackId = null,
+ string? path = null,
+ AudioMetadataDto? metadata = null,
+ int? trackNumber = null,
+ int? discNumber = null,
+ string? script = null,
+ MusicKey? key = null,
+ int? bpm = null,
+ string? work = null,
+ Guid? musicBrainzRecordingId = null,
+ Guid? musicBrainzTrackId = null,
+ Guid? musicBrainzWorkId = null,
+ List? moods = null,
+ List? isrcs = null,
+ List? contributors = null,
+ List? ratings = null,
+ bool includeOptionalProperties = true,
+ bool includeMetadata = true,
+ bool includeContributors = true,
+ bool includeRatings = true,
+ bool includeLibraryId = true,
+ bool includeArtistId = true,
+ bool includeAlbumId = true,
+ bool includeTrackId = true,
+ bool includePath = true,
+ bool includeTrackNumber = true)
+ {
+ return new UpdateTrackCommand(
+ includeLibraryId ? (libraryId ?? _faker.Random.Guid().ToString()) : null,
+ includeArtistId ? (artistId ?? _faker.Random.Guid().ToString()) : null,
+ includeAlbumId ? (albumId ?? _faker.Random.Guid().ToString()) : null,
+ includeTrackId ? (trackId ?? _faker.Random.Guid().ToString()) : null,
+ 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()) : 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,
+ includeContributors ? (contributors ?? [.. _mediaContributorReferenceDtoFixture.CreateMany(_faker.Random.Int(1, 3))]) : null,
+ includeRatings ? (ratings ?? [.. _audioRatingDtoFixture.CreateMany(_faker.Random.Int(1, 3))]) : null);
+ }
+
+ ///
+ /// Creates a list of .
+ ///
+ /// The number of elements to create.
+ /// The created list.
+ public List CreateMany(int count = 3)
+ {
+ return [.. Enumerable.Range(0, count).Select(_ => Create())];
+ }
+}
diff --git a/tests/Common/Lumina.Application.Fixtures/Core/MediaLibrary/AudioLibrary/MusicLibrary/Tracks/Queries/GetTrack/GetTrackQueryFixture.cs b/tests/Common/Lumina.Application.Fixtures/Core/MediaLibrary/AudioLibrary/MusicLibrary/Tracks/Queries/GetTrack/GetTrackQueryFixture.cs
new file mode 100644
index 00000000..2f8839d5
--- /dev/null
+++ b/tests/Common/Lumina.Application.Fixtures/Core/MediaLibrary/AudioLibrary/MusicLibrary/Tracks/Queries/GetTrack/GetTrackQueryFixture.cs
@@ -0,0 +1,55 @@
+#region ========================================================================= USING =====================================================================================
+using Lumina.Application.Core.MediaLibrary.AudioLibrary.MusicLibrary.Tracks.Queries.GetTrack;
+using System;
+using System.Collections.Generic;
+using System.Diagnostics.CodeAnalysis;
+using System.Linq;
+#endregion
+
+namespace Lumina.Application.Fixtures.Core.MediaLibrary.AudioLibrary.MusicLibrary.Tracks.Queries.GetTrack;
+
+///
+/// Fixture class for the class.
+///
+[ExcludeFromCodeCoverage]
+public class GetTrackQueryFixture
+{
+ ///
+ /// Creates a random valid .
+ ///
+ /// Optional. The Id of the media library the track belongs to.
+ /// Optional. The Id of the artist the album of the track belongs to.
+ /// Optional. The Id of the album the track belongs to.
+ /// Optional. The Id of the track to get.
+ /// Whether the library Id should be included, or forced to .
+ /// Whether the artist Id should be included, or forced to .
+ /// Whether the album Id should be included, or forced to .
+ /// Whether the track Id should be included, or forced to .
+ /// The created .
+ public GetTrackQuery Create(
+ string? libraryId = null,
+ string? artistId = null,
+ string? albumId = null,
+ string? trackId = null,
+ bool includeLibraryId = true,
+ bool includeArtistId = true,
+ bool includeAlbumId = true,
+ bool includeTrackId = true)
+ {
+ return new GetTrackQuery(
+ includeLibraryId ? (libraryId ?? Guid.NewGuid().ToString()) : null,
+ includeArtistId ? (artistId ?? Guid.NewGuid().ToString()) : null,
+ includeAlbumId ? (albumId ?? Guid.NewGuid().ToString()) : null,
+ includeTrackId ? (trackId ?? Guid.NewGuid().ToString()) : null);
+ }
+
+ ///
+ /// Creates a list of instances with randomized test data.
+ ///
+ /// Number of instances to create.
+ /// List of configured instances.
+ public List CreateMany(int count = 3)
+ {
+ return [.. Enumerable.Range(0, count).Select(_ => Create())];
+ }
+}
diff --git a/tests/Common/Lumina.Contracts.Fixtures/Core/DTO/Common/MoodDtoFixture.cs b/tests/Common/Lumina.Contracts.Fixtures/Core/DTO/Common/MoodDtoFixture.cs
new file mode 100644
index 00000000..4e27ae47
--- /dev/null
+++ b/tests/Common/Lumina.Contracts.Fixtures/Core/DTO/Common/MoodDtoFixture.cs
@@ -0,0 +1,41 @@
+#region ========================================================================= USING =====================================================================================
+using Bogus;
+using Lumina.Contracts.DTO.Common;
+using System.Collections.Generic;
+using System.Diagnostics.CodeAnalysis;
+using System.Linq;
+#endregion
+
+namespace Lumina.Contracts.Fixtures.Core.DTO.Common;
+
+///
+/// Fixture class for the record.
+///
+[ExcludeFromCodeCoverage]
+public class MoodDtoFixture
+{
+ private readonly Faker _faker = new();
+
+ ///
+ /// Creates a random valid .
+ ///
+ /// Optional. The name of the mood.
+ /// Whether the name should be included, or forced to .
+ /// The created .
+ public MoodDto Create(
+ string? name = null,
+ bool includeName = true)
+ {
+ return new MoodDto(includeName ? name ?? _faker.Lorem.Word() : null);
+ }
+
+ ///
+ /// Creates a list of .
+ ///
+ /// The number of elements to create.
+ /// The created list.
+ public List CreateMany(int count = 3)
+ {
+ return [.. Enumerable.Range(0, count).Select(_ => Create())];
+ }
+}
diff --git a/tests/Common/Lumina.Contracts.Fixtures/Core/DTO/MediaLibrary/AudioLibrary/AudioRatingDtoFixture.cs b/tests/Common/Lumina.Contracts.Fixtures/Core/DTO/MediaLibrary/AudioLibrary/AudioRatingDtoFixture.cs
new file mode 100644
index 00000000..68a8028c
--- /dev/null
+++ b/tests/Common/Lumina.Contracts.Fixtures/Core/DTO/MediaLibrary/AudioLibrary/AudioRatingDtoFixture.cs
@@ -0,0 +1,57 @@
+#region ========================================================================= USING =====================================================================================
+using AutoFixture;
+using Lumina.Contracts.DTO.MediaLibrary.AudioLibrary;
+using Lumina.Domain.SharedKernel.Common.Enums.AudioLibrary;
+using System;
+using System.Collections.Generic;
+using System.Diagnostics.CodeAnalysis;
+using System.Linq;
+#endregion
+
+namespace Lumina.Contracts.Fixtures.Core.DTO.MediaLibrary.AudioLibrary;
+
+///
+/// Fixture class for the record.
+///
+[ExcludeFromCodeCoverage]
+public class AudioRatingDtoFixture
+{
+ private readonly Fixture _fixture = new();
+ private readonly Random _random = new();
+
+ ///
+ /// Creates a random valid .
+ ///
+ /// Optional. The rating value.
+ /// Optional. The maximum possible rating value.
+ /// Optional. The rating source.
+ /// Optional. The number of votes.
+ /// Whether the rating source should be included, or forced to .
+ /// Whether the number of votes should be included, or forced to .
+ /// The created .
+ public AudioRatingDto Create(
+ decimal? value = null,
+ decimal? maxValue = null,
+ AudioRatingSource? source = null,
+ int? voteCount = null,
+ bool includeSource = true,
+ bool includeVoteCount = true)
+ {
+ return new AudioRatingDto(
+ value ?? _random.Next(1, 5),
+ maxValue ?? 5,
+ includeSource ? (source ?? _fixture.Create()) : null,
+ includeVoteCount ? (voteCount ?? _random.Next(1, 1000)) : null
+ );
+ }
+
+ ///
+ /// Creates a list of .
+ ///
+ /// The number of elements to create.
+ /// The created list.
+ public List CreateMany(int count = 3)
+ {
+ return [.. Enumerable.Range(0, count).Select(_ => Create())];
+ }
+}
diff --git a/tests/Common/Lumina.Contracts.Fixtures/Core/DTO/MediaLibrary/AudioLibrary/MusicLibrary/AudioMetadataDtoFixture.cs b/tests/Common/Lumina.Contracts.Fixtures/Core/DTO/MediaLibrary/AudioLibrary/MusicLibrary/AudioMetadataDtoFixture.cs
new file mode 100644
index 00000000..41e2c31f
--- /dev/null
+++ b/tests/Common/Lumina.Contracts.Fixtures/Core/DTO/MediaLibrary/AudioLibrary/MusicLibrary/AudioMetadataDtoFixture.cs
@@ -0,0 +1,172 @@
+#region ========================================================================= USING =====================================================================================
+using Bogus;
+using Lumina.Contracts.DTO.Common;
+using Lumina.Contracts.DTO.MediaLibrary.AudioLibrary.MusicLibrary;
+using Lumina.Contracts.Fixtures.Core.DTO.Common;
+using Lumina.Domain.SharedKernel.Common.Enums.Common;
+using System;
+using System.Collections.Generic;
+using System.Diagnostics.CodeAnalysis;
+using System.Linq;
+#endregion
+
+namespace Lumina.Contracts.Fixtures.Core.DTO.MediaLibrary.AudioLibrary.MusicLibrary;
+
+///
+/// Fixture class for the record.
+///
+[ExcludeFromCodeCoverage]
+public class AudioMetadataDtoFixture
+{
+ private readonly Faker _faker = new();
+ private readonly Random _random = new();
+ private readonly GenreDtoFixture _genreDtoFixture = new();
+ private readonly TagDtoFixture _tagDtoFixture = new();
+ private readonly LanguageInfoDtoFixture _languageInfoDtoFixture = new();
+ private readonly ReleaseInfoDtoFixture _releaseInfoDtoFixture = new();
+
+ ///
+ /// Creates a random valid .
+ ///
+ /// Optional. The title of the audio.
+ /// Optional. The original title of the audio.
+ /// Optional. A brief description or summary of the audio.
+ /// Optional. The release information of the audio.
+ /// Optional. The language of the audio.
+ /// Optional. The original language of the audio.
+ /// Optional. The tags that describe or categorize the audio.
+ /// Optional. The genres associated with the audio.
+ /// Optional. The duration of the audio, in seconds.
+ /// Optional. The sample rate of the audio, in Hz.
+ /// Optional. The number of audio channels.
+ /// Optional. The bit depth of the audio.
+ /// Optional. The audio codec used.
+ /// Optional. The bitrate of the audio, in kbps.
+ /// Whether the title should be included, or forced to .
+ /// Whether the original title should be included, or forced to .
+ /// Whether the description should be included, or forced to .
+ /// Whether the release information should be included, or forced to .
+ /// Whether the language should be included, or forced to .
+ /// Whether the original language should be included, or forced to .
+ /// Whether the tags should be included, or forced to .
+ /// Whether the genres should be included, or forced to .
+ /// Whether the duration should be included, or forced to .
+ /// Whether the sample rate should be included, or forced to .
+ /// Whether the channels should be included, or forced to .
+ /// Whether the bit depth should be included, or forced to .
+ /// Whether the audio codec should be included, or forced to .
+ /// Whether the bitrate should be included, or forced to .
+ /// The created .
+ public AudioMetadataDto Create(
+ string? title = null,
+ string? originalTitle = null,
+ string? description = null,
+ ReleaseInfoDto? releaseInfo = null,
+ LanguageInfoDto? language = null,
+ LanguageInfoDto? originalLanguage = null,
+ List? tags = null,
+ List? genres = null,
+ int? durationInSeconds = null,
+ int? sampleRate = null,
+ int? channels = null,
+ int? bitDepth = null,
+ string? audioCodec = null,
+ int? bitrate = null,
+ bool includeTitle = true,
+ bool includeOriginalTitle = true,
+ bool includeDescription = true,
+ bool includeReleaseInfo = true,
+ bool includeLanguage = true,
+ bool includeOriginalLanguage = true,
+ bool includeTags = true,
+ bool includeGenres = true,
+ bool includeDurationInSeconds = true,
+ bool includeSampleRate = true,
+ bool includeChannels = true,
+ bool includeBitDepth = true,
+ bool includeAudioCodec = true,
+ bool includeBitrate = true)
+ {
+ return new AudioMetadataDto(
+ includeTitle ? (title ?? _faker.Music.Genre()) : null,
+ includeOriginalTitle ? (originalTitle ?? _faker.Music.Genre()) : null,
+ includeDescription ? (description ?? _faker.Lorem.Paragraph()) : null,
+ includeReleaseInfo ? (releaseInfo ?? GenerateReleaseInfo()) : null,
+ includeLanguage ? (language ?? _languageInfoDtoFixture.Create()) : null,
+ includeOriginalLanguage ? (originalLanguage ?? _languageInfoDtoFixture.Create()) : null,
+ includeTags ? (tags ?? GenerateDistinctTags()) : null,
+ includeGenres ? (genres ?? GenerateDistinctGenres()) : null,
+ includeDurationInSeconds ? (durationInSeconds ?? _faker.Random.Int(60, 7200)) : null,
+ includeSampleRate ? (sampleRate ?? _faker.Random.Int(8000, 192000)) : null,
+ includeChannels ? (channels ?? _faker.Random.Int(1, 8)) : null,
+ includeBitDepth ? (bitDepth ?? _faker.Random.Int(8, 32)) : null,
+ includeAudioCodec ? (audioCodec ?? _faker.Random.ArrayElement(["FLAC", "MP3", "AAC", "ALAC"])) : null,
+ includeBitrate ? (bitrate ?? _faker.Random.Int(96, 1411)) : null);
+ }
+
+ ///
+ /// Creates a list of .
+ ///
+ /// The number of elements to create.
+ /// The created list.
+ public List CreateMany(int count = 3)
+ {
+ return [.. Enumerable.Range(0, count).Select(_ => Create())];
+ }
+
+ ///
+ /// Creates a random valid with consistent dates and years.
+ ///
+ /// The created .
+ private ReleaseInfoDto GenerateReleaseInfo()
+ {
+ int originalReleaseYear = _random.Next(1900, 2026);
+ int reReleaseYear = _random.Next(originalReleaseYear, 2026);
+ return _releaseInfoDtoFixture.Create(
+ originalReleaseDate: new DateOnly(originalReleaseYear, 1, 1),
+ originalReleaseYear: originalReleaseYear,
+ reReleaseDate: new DateOnly(reReleaseYear, 1, 1),
+ reReleaseYear: reReleaseYear,
+ releaseCountry: _faker.PickRandom(),
+ releaseVersion: _faker.Random.String2(_faker.Random.Number(1, 50)));
+ }
+
+ ///
+ /// Creates two genres with distinct names, so that the storage deduplication never collapses them into one.
+ ///
+ /// The created genres.
+ private List GenerateDistinctGenres()
+ {
+ return
+ [
+ _genreDtoFixture.Create(name: CreateUniqueName()),
+ _genreDtoFixture.Create(name: CreateUniqueName())
+ ];
+ }
+
+ ///
+ /// Creates two tags with distinct names, so that the storage deduplication never collapses them into one.
+ ///
+ /// The created tags.
+ private List GenerateDistinctTags()
+ {
+ return
+ [
+ _tagDtoFixture.Create(name: CreateUniqueName()),
+ _tagDtoFixture.Create(name: CreateUniqueName())
+ ];
+ }
+
+ ///
+ /// Creates a unique name, so that the generated genres and tags never collapse into one after storage deduplication.
+ ///
+ /// A unique name of at most 50 characters.
+ private string CreateUniqueName()
+ {
+ string uniqueSuffix = Guid.NewGuid().ToString("N")[..12];
+ int maximumWordLength = 50 - uniqueSuffix.Length - 1;
+ string word = _faker.Lorem.Word();
+ string truncatedWord = word.Length > maximumWordLength ? word[..maximumWordLength] : word;
+ return $"{truncatedWord}-{uniqueSuffix}";
+ }
+}
diff --git a/tests/Common/Lumina.Contracts.Fixtures/Core/DTO/MediaLibrary/AudioLibrary/MusicLibrary/IsrcDtoFixture.cs b/tests/Common/Lumina.Contracts.Fixtures/Core/DTO/MediaLibrary/AudioLibrary/MusicLibrary/IsrcDtoFixture.cs
new file mode 100644
index 00000000..7ec98766
--- /dev/null
+++ b/tests/Common/Lumina.Contracts.Fixtures/Core/DTO/MediaLibrary/AudioLibrary/MusicLibrary/IsrcDtoFixture.cs
@@ -0,0 +1,56 @@
+#region ========================================================================= USING =====================================================================================
+using Bogus;
+using Lumina.Contracts.DTO.MediaLibrary.AudioLibrary.MusicLibrary;
+using System.Collections.Generic;
+using System.Diagnostics.CodeAnalysis;
+using System.Linq;
+#endregion
+
+namespace Lumina.Contracts.Fixtures.Core.DTO.MediaLibrary.AudioLibrary.MusicLibrary;
+
+///
+/// Fixture class for the record.
+///
+[ExcludeFromCodeCoverage]
+public class IsrcDtoFixture
+{
+ private const string LETTERS = "ABCDEFGHIJKLMNOPQRSTUVWXYZ";
+ private const string ALPHANUMERICS = "ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789";
+ private const string DIGITS = "0123456789";
+
+ private readonly Faker _faker = new();
+
+ ///
+ /// Creates a random valid .
+ ///
+ /// Optional. The value of the ISRC.
+ /// Whether the value should be included, or forced to .
+ /// The created .
+ public IsrcDto Create(
+ string? value = null,
+ bool includeValue = true)
+ {
+ return new IsrcDto(includeValue ? value ?? GenerateValidIsrc() : null);
+ }
+
+ ///
+ /// Creates a list of .
+ ///
+ /// The number of elements to create.
+ /// The created list.
+ public List CreateMany(int count = 3)
+ {
+ return [.. Enumerable.Range(0, count).Select(_ => Create())];
+ }
+
+ ///
+ /// Generates a random ISRC that satisfies the domain format: two letters, three alphanumeric characters and seven digits.
+ ///
+ /// The generated ISRC value.
+ private string GenerateValidIsrc()
+ {
+ return _faker.Random.String2(2, LETTERS)
+ + _faker.Random.String2(3, ALPHANUMERICS)
+ + _faker.Random.String2(7, DIGITS);
+ }
+}
diff --git a/tests/Common/Lumina.Contracts.Fixtures/Core/Requests/MediaLibrary/AudioLibrary/MusicLibrary/Albums/GetAlbumTracksLiteRequestFixture.cs b/tests/Common/Lumina.Contracts.Fixtures/Core/Requests/MediaLibrary/AudioLibrary/MusicLibrary/Albums/GetAlbumTracksLiteRequestFixture.cs
new file mode 100644
index 00000000..829fbd00
--- /dev/null
+++ b/tests/Common/Lumina.Contracts.Fixtures/Core/Requests/MediaLibrary/AudioLibrary/MusicLibrary/Albums/GetAlbumTracksLiteRequestFixture.cs
@@ -0,0 +1,47 @@
+#region ========================================================================= USING =====================================================================================
+using Bogus;
+using Lumina.Contracts.Requests.MediaLibrary.AudioLibrary.MusicLibrary.Albums;
+using System.Collections.Generic;
+using System.Diagnostics.CodeAnalysis;
+using System.Linq;
+#endregion
+
+namespace Lumina.Contracts.Fixtures.Core.Requests.MediaLibrary.AudioLibrary.MusicLibrary.Albums;
+
+///
+/// Fixture class for the record.
+///
+[ExcludeFromCodeCoverage]
+public class GetAlbumTracksLiteRequestFixture
+{
+ private readonly Faker _faker = new();
+
+ ///
+ /// Creates a with default or random values.
+ ///
+ /// Optional. The page of results to retrieve.
+ /// Optional. The maximum number of tracks to retrieve per page.
+ /// Whether the current page should be included, or forced to .
+ /// Whether the per page count should be included, or forced to .
+ /// The created .
+ public GetAlbumTracksLiteRequest Create(
+ int? currentPage = null,
+ int? perPage = null,
+ bool includeCurrentPage = true,
+ bool includePerPage = true)
+ {
+ return new GetAlbumTracksLiteRequest(
+ CurrentPage: includeCurrentPage ? (currentPage ?? _faker.Random.Number(1, 100)) : null,
+ PerPage: includePerPage ? (perPage ?? _faker.Random.Number(1, 200)) : null);
+ }
+
+ ///
+ /// Creates a list of .
+ ///
+ /// The number of elements to create.
+ /// The created list.
+ public List CreateMany(int count = 3)
+ {
+ return [.. Enumerable.Range(0, count).Select(_ => Create())];
+ }
+}
diff --git a/tests/Common/Lumina.Contracts.Fixtures/Core/Requests/MediaLibrary/AudioLibrary/MusicLibrary/Artists/UpdateArtistTrackRequestFixture.cs b/tests/Common/Lumina.Contracts.Fixtures/Core/Requests/MediaLibrary/AudioLibrary/MusicLibrary/Artists/UpdateArtistTrackRequestFixture.cs
new file mode 100644
index 00000000..82dc2e26
--- /dev/null
+++ b/tests/Common/Lumina.Contracts.Fixtures/Core/Requests/MediaLibrary/AudioLibrary/MusicLibrary/Artists/UpdateArtistTrackRequestFixture.cs
@@ -0,0 +1,115 @@
+#region ========================================================================= USING =====================================================================================
+using Bogus;
+using Lumina.Contracts.DTO.Common;
+using Lumina.Contracts.DTO.MediaContributors;
+using Lumina.Contracts.DTO.MediaLibrary.AudioLibrary;
+using Lumina.Contracts.DTO.MediaLibrary.AudioLibrary.MusicLibrary;
+using Lumina.Contracts.Fixtures.Core.DTO.Common;
+using Lumina.Contracts.Fixtures.Core.DTO.MediaContributors;
+using Lumina.Contracts.Fixtures.Core.DTO.MediaLibrary.AudioLibrary;
+using Lumina.Contracts.Fixtures.Core.DTO.MediaLibrary.AudioLibrary.MusicLibrary;
+using Lumina.Contracts.Requests.MediaLibrary.AudioLibrary.MusicLibrary.Artists;
+using Lumina.Domain.SharedKernel.Common.Enums.AudioLibrary;
+using System;
+using System.Collections.Generic;
+using System.Diagnostics.CodeAnalysis;
+using System.IO;
+using System.Linq;
+#endregion
+
+namespace Lumina.Contracts.Fixtures.Core.Requests.MediaLibrary.AudioLibrary.MusicLibrary.Artists;
+
+///
+/// Fixture class for the record.
+///
+[ExcludeFromCodeCoverage]
+public class UpdateArtistTrackRequestFixture
+{
+ private readonly Faker _faker = new();
+ private readonly AudioMetadataDtoFixture _audioMetadataDtoFixture = new();
+ private readonly MoodDtoFixture _moodDtoFixture = new();
+ private readonly IsrcDtoFixture _isrcDtoFixture = new();
+ private readonly MediaContributorReferenceDtoFixture _mediaContributorReferenceDtoFixture = new();
+ private readonly AudioRatingDtoFixture _audioRatingDtoFixture = new();
+
+ ///
+ /// Creates a random valid request to update a track of an album of an artist.
+ ///
+ /// Optional. The Id of the track, when the track already exists.
+ /// Optional. The file system path of the track.
+ /// Optional. The audio metadata of the track.
+ /// Optional. The number of the track on its disc.
+ /// Optional. The number of the disc the track belongs to.
+ /// Optional. The script used by the language of the track.
+ /// Optional. The musical key of the track.
+ /// Optional. The tempo of the track in beats per minute.
+ /// Optional. The title of the work the track is a recording of.
+ /// Optional. The MusicBrainz identifier of the recording.
+ /// Optional. The MusicBrainz identifier of the track.
+ /// Optional. The MusicBrainz identifier of the work.
+ /// Optional. The moods of the track.
+ /// Optional. The ISRC codes of the track.
+ /// Optional. The media contributors that performed on the track.
+ /// Optional. The ratings of the track.
+ /// Whether the track Id should be included, or forced to .
+ /// Whether the path should be included, or forced to .
+ /// Whether the metadata should be included, or forced to .
+ /// Whether the track number should be included, or forced to .
+ /// Whether the optional properties that are not explicitly provided should be randomized, or forced to .
+ /// Whether the contributors list should be included, or forced to .
+ /// Whether the ratings list should be included, or forced to .
+ /// The created request to update a track of an album of an artist.
+ public UpdateArtistTrackRequest Create(
+ Guid? trackId = null,
+ string? path = null,
+ AudioMetadataDto? metadata = null,
+ int? trackNumber = null,
+ int? discNumber = null,
+ string? script = null,
+ MusicKey? key = null,
+ int? bpm = null,
+ string? work = null,
+ Guid? musicBrainzRecordingId = null,
+ Guid? musicBrainzTrackId = null,
+ Guid? musicBrainzWorkId = null,
+ List? moods = null,
+ List? isrcs = null,
+ List? contributors = null,
+ List? ratings = null,
+ bool includeTrackId = true,
+ bool includePath = true,
+ bool includeMetadata = true,
+ bool includeTrackNumber = true,
+ bool includeOptionalProperties = true,
+ bool includeContributors = true,
+ bool includeRatings = true)
+ {
+ return new UpdateArtistTrackRequest(
+ includeTrackId ? (trackId ?? _faker.Random.Guid()) : null,
+ 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()) : 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,
+ includeContributors ? (contributors ?? [.. _mediaContributorReferenceDtoFixture.CreateMany(_faker.Random.Int(1, 3))]) : null,
+ includeRatings ? (ratings ?? [.. _audioRatingDtoFixture.CreateMany(_faker.Random.Int(1, 3))]) : null);
+ }
+
+ ///
+ /// Creates a list of .
+ ///
+ /// The number of elements to create.
+ /// The created list.
+ public List CreateMany(int count = 3)
+ {
+ return [.. Enumerable.Range(0, count).Select(_ => Create())];
+ }
+}
diff --git a/tests/Common/Lumina.Contracts.Fixtures/Core/Requests/MediaLibrary/AudioLibrary/MusicLibrary/Tracks/AddTrackRequestFixture.cs b/tests/Common/Lumina.Contracts.Fixtures/Core/Requests/MediaLibrary/AudioLibrary/MusicLibrary/Tracks/AddTrackRequestFixture.cs
new file mode 100644
index 00000000..7aa37d24
--- /dev/null
+++ b/tests/Common/Lumina.Contracts.Fixtures/Core/Requests/MediaLibrary/AudioLibrary/MusicLibrary/Tracks/AddTrackRequestFixture.cs
@@ -0,0 +1,110 @@
+#region ========================================================================= USING =====================================================================================
+using Bogus;
+using Lumina.Contracts.DTO.Common;
+using Lumina.Contracts.DTO.MediaContributors;
+using Lumina.Contracts.DTO.MediaLibrary.AudioLibrary;
+using Lumina.Contracts.DTO.MediaLibrary.AudioLibrary.MusicLibrary;
+using Lumina.Contracts.Fixtures.Core.DTO.Common;
+using Lumina.Contracts.Fixtures.Core.DTO.MediaContributors;
+using Lumina.Contracts.Fixtures.Core.DTO.MediaLibrary.AudioLibrary;
+using Lumina.Contracts.Fixtures.Core.DTO.MediaLibrary.AudioLibrary.MusicLibrary;
+using Lumina.Contracts.Requests.MediaLibrary.AudioLibrary.MusicLibrary.Tracks;
+using Lumina.Domain.SharedKernel.Common.Enums.AudioLibrary;
+using System;
+using System.Collections.Generic;
+using System.Diagnostics.CodeAnalysis;
+using System.IO;
+using System.Linq;
+#endregion
+
+namespace Lumina.Contracts.Fixtures.Core.Requests.MediaLibrary.AudioLibrary.MusicLibrary.Tracks;
+
+///
+/// Fixture class for the class.
+///
+[ExcludeFromCodeCoverage]
+public class AddTrackRequestFixture
+{
+ private readonly Faker _faker = new();
+ private readonly AudioMetadataDtoFixture _audioMetadataDtoFixture = new();
+ private readonly MoodDtoFixture _moodDtoFixture = new();
+ private readonly IsrcDtoFixture _isrcDtoFixture = new();
+ private readonly MediaContributorReferenceDtoFixture _mediaContributorReferenceDtoFixture = new();
+ private readonly AudioRatingDtoFixture _audioRatingDtoFixture = new();
+
+ ///
+ /// Creates a random valid request to add a track.
+ ///
+ /// Optional. The file system path of the track.
+ /// Optional. The audio metadata of the track.
+ /// Optional. The number of the track on its disc.
+ /// Optional. The number of the disc the track belongs to.
+ /// Optional. The script used by the language of the track.
+ /// Optional. The musical key of the track.
+ /// Optional. The tempo of the track in beats per minute.
+ /// Optional. The title of the work the track is a recording of.
+ /// Optional. The MusicBrainz identifier of the recording.
+ /// Optional. The MusicBrainz identifier of the track.
+ /// Optional. The MusicBrainz identifier of the work.
+ /// Optional. The list of moods of the track.
+ /// Optional. The list of ISRC of the track.
+ /// Optional. The list of media contributors that performed on the track.
+ /// Optional. The list of ratings for this track.
+ /// Whether the path should be included, or forced to .
+ /// Whether the metadata should be included, or forced to .
+ /// Whether the track number should be included, or forced to .
+ /// Whether the properties that are not explicitly provided should be randomized, or forced to .
+ /// Whether the contributors should be included, or forced to .
+ /// Whether the ratings should be included, or forced to .
+ /// The created request to add a track.
+ public AddTrackRequest Create(
+ string? path = null,
+ AudioMetadataDto? metadata = null,
+ int? trackNumber = null,
+ int? discNumber = null,
+ string? script = null,
+ MusicKey? key = null,
+ int? bpm = null,
+ string? work = null,
+ Guid? musicBrainzRecordingId = null,
+ Guid? musicBrainzTrackId = null,
+ Guid? musicBrainzWorkId = null,
+ List? moods = null,
+ List? isrcs = null,
+ List? contributors = null,
+ List? ratings = null,
+ bool includePath = true,
+ bool includeMetadata = true,
+ bool includeTrackNumber = true,
+ bool includeOptionalProperties = true,
+ bool includeContributors = true,
+ bool includeRatings = true)
+ {
+ return new AddTrackRequest(
+ 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() : 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,
+ includeContributors ? contributors ?? _mediaContributorReferenceDtoFixture.CreateMany(_faker.Random.Int(1, 3)) : null,
+ includeRatings ? ratings ?? _audioRatingDtoFixture.CreateMany(_faker.Random.Int(1, 3)) : null);
+ }
+
+ ///
+ /// Creates a list of .
+ ///
+ /// The number of elements to create.
+ /// The created list.
+ public List CreateMany(int count = 3)
+ {
+ return [.. Enumerable.Range(0, count).Select(_ => Create())];
+ }
+}
diff --git a/tests/Common/Lumina.Contracts.Fixtures/Core/Requests/MediaLibrary/AudioLibrary/MusicLibrary/Tracks/UpdateTrackRequestFixture.cs b/tests/Common/Lumina.Contracts.Fixtures/Core/Requests/MediaLibrary/AudioLibrary/MusicLibrary/Tracks/UpdateTrackRequestFixture.cs
new file mode 100644
index 00000000..8a37b112
--- /dev/null
+++ b/tests/Common/Lumina.Contracts.Fixtures/Core/Requests/MediaLibrary/AudioLibrary/MusicLibrary/Tracks/UpdateTrackRequestFixture.cs
@@ -0,0 +1,109 @@
+#region ========================================================================= USING =====================================================================================
+using Bogus;
+using Lumina.Contracts.DTO.Common;
+using Lumina.Contracts.DTO.MediaContributors;
+using Lumina.Contracts.DTO.MediaLibrary.AudioLibrary;
+using Lumina.Contracts.DTO.MediaLibrary.AudioLibrary.MusicLibrary;
+using Lumina.Contracts.Fixtures.Core.DTO.Common;
+using Lumina.Contracts.Fixtures.Core.DTO.MediaContributors;
+using Lumina.Contracts.Fixtures.Core.DTO.MediaLibrary.AudioLibrary;
+using Lumina.Contracts.Fixtures.Core.DTO.MediaLibrary.AudioLibrary.MusicLibrary;
+using Lumina.Contracts.Requests.MediaLibrary.AudioLibrary.MusicLibrary.Tracks;
+using Lumina.Domain.SharedKernel.Common.Enums.AudioLibrary;
+using System;
+using System.Collections.Generic;
+using System.Diagnostics.CodeAnalysis;
+using System.Linq;
+#endregion
+
+namespace Lumina.Contracts.Fixtures.Core.Requests.MediaLibrary.AudioLibrary.MusicLibrary.Tracks;
+
+///
+/// Fixture class for the record.
+///
+[ExcludeFromCodeCoverage]
+public class UpdateTrackRequestFixture
+{
+ private readonly Faker _faker = new();
+ private readonly AudioMetadataDtoFixture _audioMetadataDtoFixture = new();
+ private readonly MoodDtoFixture _moodDtoFixture = new();
+ private readonly IsrcDtoFixture _isrcDtoFixture = new();
+ private readonly MediaContributorReferenceDtoFixture _mediaContributorReferenceDtoFixture = new();
+ private readonly AudioRatingDtoFixture _audioRatingDtoFixture = new();
+
+ ///
+ /// Creates a random valid request to update a track.
+ ///
+ /// Optional. The file system path of the track.
+ /// Optional. The audio metadata of the track.
+ /// Optional. The number of the track on its disc.
+ /// Optional. The number of the disc the track belongs to.
+ /// Optional. The script used by the language of the track.
+ /// Optional. The musical key of the track.
+ /// Optional. The tempo of the track in beats per minute.
+ /// Optional. The title of the work the track is a recording of.
+ /// Optional. The MusicBrainz identifier of the recording.
+ /// Optional. The MusicBrainz identifier of the track.
+ /// Optional. The MusicBrainz identifier of the work.
+ /// Optional. The moods of the track.
+ /// Optional. The ISRC codes of the track.
+ /// Optional. The media contributors that performed on the track.
+ /// Optional. The ratings of the track.
+ /// Whether the optional properties that are not explicitly provided should be randomized, or forced to .
+ /// Whether the contributors list should be included, or forced to .
+ /// Whether the ratings list should be included, or forced to .
+ /// Whether the path should be included, or forced to .
+ /// Whether the metadata should be included, or forced to .
+ /// Whether the track number should be included, or forced to .
+ /// The created request to update a track.
+ public UpdateTrackRequest Create(
+ string? path = null,
+ AudioMetadataDto? metadata = null,
+ int? trackNumber = null,
+ int? discNumber = null,
+ string? script = null,
+ MusicKey? key = null,
+ int? bpm = null,
+ string? work = null,
+ Guid? musicBrainzRecordingId = null,
+ Guid? musicBrainzTrackId = null,
+ Guid? musicBrainzWorkId = null,
+ List? moods = null,
+ List? isrcs = null,
+ List? contributors = null,
+ List? ratings = null,
+ bool includeOptionalProperties = true,
+ bool includeContributors = true,
+ bool includeRatings = true,
+ bool includePath = true,
+ bool includeMetadata = true,
+ bool includeTrackNumber = true)
+ {
+ return new UpdateTrackRequest(
+ 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()) : 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,
+ includeContributors ? (contributors ?? [.. _mediaContributorReferenceDtoFixture.CreateMany(_faker.Random.Int(1, 3))]) : null,
+ includeRatings ? (ratings ?? [.. _audioRatingDtoFixture.CreateMany(_faker.Random.Int(1, 3))]) : null);
+ }
+
+ ///
+ /// Creates a list of .
+ ///
+ /// The number of elements to create.
+ /// The created list.
+ public List CreateMany(int count = 3)
+ {
+ return [.. Enumerable.Range(0, count).Select(_ => Create())];
+ }
+}
diff --git a/tests/Common/Lumina.Contracts.Fixtures/Core/Responses/MediaLibrary/AudioLibrary/MusicLibrary/Tracks/TrackResponseFixture.cs b/tests/Common/Lumina.Contracts.Fixtures/Core/Responses/MediaLibrary/AudioLibrary/MusicLibrary/Tracks/TrackResponseFixture.cs
new file mode 100644
index 00000000..2c009ff5
--- /dev/null
+++ b/tests/Common/Lumina.Contracts.Fixtures/Core/Responses/MediaLibrary/AudioLibrary/MusicLibrary/Tracks/TrackResponseFixture.cs
@@ -0,0 +1,118 @@
+#region ========================================================================= USING =====================================================================================
+using Bogus;
+using Lumina.Contracts.DTO.Common;
+using Lumina.Contracts.DTO.MediaContributors;
+using Lumina.Contracts.DTO.MediaLibrary.AudioLibrary;
+using Lumina.Contracts.DTO.MediaLibrary.AudioLibrary.MusicLibrary;
+using Lumina.Contracts.Fixtures.Core.DTO.Common;
+using Lumina.Contracts.Fixtures.Core.DTO.MediaContributors;
+using Lumina.Contracts.Fixtures.Core.DTO.MediaLibrary.AudioLibrary;
+using Lumina.Contracts.Fixtures.Core.DTO.MediaLibrary.AudioLibrary.MusicLibrary;
+using Lumina.Contracts.Responses.MediaLibrary.AudioLibrary.MusicLibrary.Tracks;
+using Lumina.Domain.SharedKernel.Common.Enums.AudioLibrary;
+using System;
+using System.Collections.Generic;
+using System.Diagnostics.CodeAnalysis;
+using System.Linq;
+#endregion
+
+namespace Lumina.Contracts.Fixtures.Core.Responses.MediaLibrary.AudioLibrary.MusicLibrary.Tracks;
+
+///
+/// Fixture class for the record.
+///
+[ExcludeFromCodeCoverage]
+public class TrackResponseFixture
+{
+ private readonly Faker _faker = new();
+ private readonly AudioMetadataDtoFixture _audioMetadataDtoFixture = new();
+ private readonly MoodDtoFixture _moodDtoFixture = new();
+ private readonly IsrcDtoFixture _isrcDtoFixture = new();
+ private readonly MediaContributorReferenceDtoFixture _mediaContributorReferenceDtoFixture = new();
+ private readonly AudioRatingDtoFixture _audioRatingDtoFixture = new();
+
+ ///
+ /// Creates a random valid .
+ ///
+ /// Optional. The Id of the track.
+ /// Optional. The Id of the album the track belongs to.
+ /// Optional. The Id of the media library this track belongs to.
+ /// Optional. The file system path of the track.
+ /// Optional. The audio metadata of the track.
+ /// Optional. The number of the track on its disc.
+ /// Optional. The number of the disc the track belongs to.
+ /// Optional. The script used by the language of the track.
+ /// Optional. The musical key of the track.
+ /// Optional. The tempo of the track in beats per minute.
+ /// Optional. The title of the work the track is a recording of.
+ /// Optional. The MusicBrainz recording Id of the track.
+ /// Optional. The MusicBrainz track Id of the track.
+ /// Optional. The MusicBrainz work Id of the track.
+ /// Optional. The date and time when the track was created.
+ /// Optional. The date and time when the track was updated.
+ /// Optional. The list of moods of the track.
+ /// Optional. The list of ISRCs of the track.
+ /// Optional. The list of contributor references of the track.
+ /// Optional. The list of ratings of the track.
+ /// Whether the MusicBrainz recording Id should be included, or forced to .
+ /// Whether the MusicBrainz track Id should be included, or forced to .
+ /// Whether the MusicBrainz work Id should be included, or forced to .
+ /// The created .
+ public TrackResponse Create(
+ Guid? id = null,
+ Guid? albumId = null,
+ Guid? libraryId = null,
+ string? path = null,
+ AudioMetadataDto? metadata = null,
+ int? trackNumber = null,
+ int? discNumber = null,
+ string? script = null,
+ MusicKey? key = null,
+ int? bpm = null,
+ string? work = null,
+ Guid? musicBrainzRecordingId = null,
+ Guid? musicBrainzTrackId = null,
+ Guid? musicBrainzWorkId = null,
+ DateTime? createdOnUtc = null,
+ DateTime? updatedOnUtc = null,
+ List? moods = null,
+ List? isrcs = null,
+ List? contributors = null,
+ List? ratings = null,
+ bool includeMusicBrainzRecordingId = true,
+ bool includeMusicBrainzTrackId = true,
+ bool includeMusicBrainzWorkId = true)
+ {
+ return new TrackResponse(
+ id ?? Guid.NewGuid(),
+ albumId ?? Guid.NewGuid(),
+ libraryId ?? Guid.NewGuid(),
+ path ?? _faker.System.FilePath(),
+ metadata ?? _audioMetadataDtoFixture.Create(),
+ trackNumber ?? _faker.Random.Int(1, 30),
+ discNumber ?? (_faker.Random.Bool() ? _faker.Random.Int(1, 3) : null),
+ script ?? (_faker.Random.Bool() ? _faker.Random.AlphaNumeric(4) : null),
+ key ?? (_faker.Random.Bool() ? _faker.PickRandom() : null),
+ bpm ?? (_faker.Random.Bool() ? _faker.Random.Int(40, 220) : null),
+ work ?? (_faker.Random.Bool() ? _faker.Lorem.Sentence() : null),
+ includeMusicBrainzRecordingId ? (musicBrainzRecordingId ?? Guid.NewGuid()) : null,
+ includeMusicBrainzTrackId ? (musicBrainzTrackId ?? Guid.NewGuid()) : null,
+ includeMusicBrainzWorkId ? (musicBrainzWorkId ?? Guid.NewGuid()) : null,
+ createdOnUtc ?? _faker.Date.Past().ToUniversalTime(),
+ updatedOnUtc ?? (_faker.Random.Bool() ? _faker.Date.Recent().ToUniversalTime() : null),
+ moods ?? _moodDtoFixture.CreateMany(1),
+ isrcs ?? _isrcDtoFixture.CreateMany(1),
+ contributors ?? _mediaContributorReferenceDtoFixture.CreateMany(1),
+ ratings ?? _audioRatingDtoFixture.CreateMany(1));
+ }
+
+ ///
+ /// Creates a list of .
+ ///
+ /// The number of elements to create.
+ /// The created list.
+ public List CreateMany(int count = 3)
+ {
+ return [.. Enumerable.Range(0, count).Select(_ => Create())];
+ }
+}
diff --git a/tests/Common/Lumina.Domain.Fixtures/Common/ValueObjects/Metadata/MoodFixture.cs b/tests/Common/Lumina.Domain.Fixtures/Common/ValueObjects/Metadata/MoodFixture.cs
new file mode 100644
index 00000000..3d56c4ed
--- /dev/null
+++ b/tests/Common/Lumina.Domain.Fixtures/Common/ValueObjects/Metadata/MoodFixture.cs
@@ -0,0 +1,45 @@
+#region ========================================================================= USING =====================================================================================
+using Bogus;
+using Lumina.Domain.Common.Primitives;
+using Lumina.Domain.Common.ValueObjects.Metadata;
+using System;
+using System.Collections.Generic;
+using System.Diagnostics.CodeAnalysis;
+using System.Linq;
+#endregion
+
+namespace Lumina.Domain.Fixtures.Common.ValueObjects.Metadata;
+
+///
+/// Fixture class for the domain value object.
+///
+[ExcludeFromCodeCoverage]
+public class MoodFixture
+{
+ private readonly Faker _faker = new();
+
+ ///
+ /// Creates a random valid .
+ ///
+ /// Optional. The name of the mood. If not provided, a random name is generated.
+ /// The created .
+ public Mood Create(
+ string? name = null)
+ {
+ Result moodResult = Mood.Create(name ?? _faker.Lorem.Word());
+
+ if (moodResult.IsFailure)
+ throw new InvalidOperationException("Failed to create Mood: " + string.Join(", ", moodResult.Errors));
+ return moodResult.Value;
+ }
+
+ ///
+ /// Creates multiple instances with randomized test data.
+ ///
+ /// Number of instances to create.
+ /// List of configured instances.
+ public List CreateMany(int count = 3)
+ {
+ return [.. Enumerable.Range(0, count).Select(_ => Create())];
+ }
+}
diff --git a/tests/Common/Lumina.Domain.Fixtures/Core/BoundedContexts/AudioLibraryBoundedContext/ExternalIdentifiers/LibraryManagementBoundedContext/LibraryAggregate/LibraryIdFixture.cs b/tests/Common/Lumina.Domain.Fixtures/Core/BoundedContexts/AudioLibraryBoundedContext/ExternalIdentifiers/LibraryManagementBoundedContext/LibraryAggregate/LibraryIdFixture.cs
new file mode 100644
index 00000000..6c434ed6
--- /dev/null
+++ b/tests/Common/Lumina.Domain.Fixtures/Core/BoundedContexts/AudioLibraryBoundedContext/ExternalIdentifiers/LibraryManagementBoundedContext/LibraryAggregate/LibraryIdFixture.cs
@@ -0,0 +1,37 @@
+#region ========================================================================= USING =====================================================================================
+using Lumina.Domain.Core.BoundedContexts.AudioLibraryBoundedContext.ExternalIdentifiers.LibraryManagementBoundedContext.LibraryAggregate;
+using System;
+using System.Collections.Generic;
+using System.Diagnostics.CodeAnalysis;
+using System.Linq;
+#endregion
+
+namespace Lumina.Domain.Fixtures.Core.BoundedContexts.AudioLibraryBoundedContext.ExternalIdentifiers.LibraryManagementBoundedContext.LibraryAggregate;
+
+///
+/// Fixture class for the domain value object.
+///
+[ExcludeFromCodeCoverage]
+public class LibraryIdFixture
+{
+ ///
+ /// Creates a random valid .
+ ///
+ /// Optional. The raw value of the library Id.
+ /// The created .
+ public LibraryId Create(
+ Guid? value = null)
+ {
+ return value is null ? LibraryId.CreateUnique() : LibraryId.Create(value.Value);
+ }
+
+ ///
+ /// Creates a list of instances with randomized test data.
+ ///
+ /// Number of instances to create.
+ /// List of configured instances.
+ public List CreateMany(int count = 3)
+ {
+ return [.. Enumerable.Range(0, count).Select(_ => Create())];
+ }
+}
diff --git a/tests/Common/Lumina.Domain.Fixtures/Core/BoundedContexts/AudioLibraryBoundedContext/ExternalIdentifiers/MediaContributorBoundedContext/MediaContributorAggregate/MediaContributorIdFixture.cs b/tests/Common/Lumina.Domain.Fixtures/Core/BoundedContexts/AudioLibraryBoundedContext/ExternalIdentifiers/MediaContributorBoundedContext/MediaContributorAggregate/MediaContributorIdFixture.cs
new file mode 100644
index 00000000..4afa0f55
--- /dev/null
+++ b/tests/Common/Lumina.Domain.Fixtures/Core/BoundedContexts/AudioLibraryBoundedContext/ExternalIdentifiers/MediaContributorBoundedContext/MediaContributorAggregate/MediaContributorIdFixture.cs
@@ -0,0 +1,37 @@
+#region ========================================================================= USING =====================================================================================
+using Lumina.Domain.Core.BoundedContexts.AudioLibraryBoundedContext.ExternalIdentifiers.MediaContributorBoundedContext.MediaContributorAggregate;
+using System;
+using System.Collections.Generic;
+using System.Diagnostics.CodeAnalysis;
+using System.Linq;
+#endregion
+
+namespace Lumina.Domain.Fixtures.Core.BoundedContexts.AudioLibraryBoundedContext.ExternalIdentifiers.MediaContributorBoundedContext.MediaContributorAggregate;
+
+///
+/// Fixture class for the domain value object.
+///
+[ExcludeFromCodeCoverage]
+public class MediaContributorIdFixture
+{
+ ///
+ /// Creates a random valid .
+ ///
+ /// Optional. The raw value of the media contributor Id.
+ /// The created .
+ public MediaContributorId Create(
+ Guid? value = null)
+ {
+ return value is null ? MediaContributorId.CreateUnique() : MediaContributorId.Create(value.Value);
+ }
+
+ ///
+ /// Creates a list of instances with randomized test data.
+ ///
+ /// Number of instances to create.
+ /// List of configured instances.
+ public List CreateMany(int count = 3)
+ {
+ return [.. Enumerable.Range(0, count).Select(_ => Create())];
+ }
+}
diff --git a/tests/Common/Lumina.Domain.Fixtures/Core/BoundedContexts/AudioLibraryBoundedContext/MusicLibraryAggregate/ArtistFixture.cs b/tests/Common/Lumina.Domain.Fixtures/Core/BoundedContexts/AudioLibraryBoundedContext/MusicLibraryAggregate/ArtistFixture.cs
new file mode 100644
index 00000000..5182b00c
--- /dev/null
+++ b/tests/Common/Lumina.Domain.Fixtures/Core/BoundedContexts/AudioLibraryBoundedContext/MusicLibraryAggregate/ArtistFixture.cs
@@ -0,0 +1,71 @@
+#region ========================================================================= USING =====================================================================================
+using Bogus;
+using Lumina.Domain.Common.Primitives;
+using Lumina.Domain.Core.BoundedContexts.AudioLibraryBoundedContext.ExternalIdentifiers.LibraryManagementBoundedContext.LibraryAggregate;
+using Lumina.Domain.Core.BoundedContexts.AudioLibraryBoundedContext.MusicLibraryAggregate;
+using Lumina.Domain.Core.BoundedContexts.AudioLibraryBoundedContext.MusicLibraryAggregate.Entities;
+using Lumina.Domain.Core.BoundedContexts.AudioLibraryBoundedContext.MusicLibraryAggregate.ValueObjects;
+using Lumina.Domain.Fixtures.Core.BoundedContexts.AudioLibraryBoundedContext.ExternalIdentifiers.LibraryManagementBoundedContext.LibraryAggregate;
+using Lumina.Domain.Fixtures.Core.BoundedContexts.AudioLibraryBoundedContext.MusicLibraryAggregate.Entities;
+using Lumina.Domain.Fixtures.Core.BoundedContexts.AudioLibraryBoundedContext.MusicLibraryAggregate.ValueObjects;
+using System;
+using System.Collections.Generic;
+using System.Diagnostics.CodeAnalysis;
+using System.Linq;
+#endregion
+
+namespace Lumina.Domain.Fixtures.Core.BoundedContexts.AudioLibraryBoundedContext.MusicLibraryAggregate;
+
+///
+/// Fixture class for the domain aggregate root.
+///
+[ExcludeFromCodeCoverage]
+public class ArtistFixture
+{
+ private readonly Faker _faker = new();
+ private readonly LibraryIdFixture _libraryIdFixture = new();
+ private readonly AlbumFixture _albumFixture = new();
+ private readonly MusicBrainzIdFixture _musicBrainzIdFixture = new();
+ private readonly MusicMediaContributorFixture _musicMediaContributorFixture = new();
+
+ ///
+ /// Creates a random valid domain aggregate root.
+ ///
+ /// Optional. The Id of the media library this artist belongs to.
+ /// Optional. The name of the artist.
+ /// Optional. The website of the artist.
+ /// Optional. The MusicBrainz identifier of the artist.
+ /// Optional. The media contributors that make up the artist.
+ /// Optional. The albums of the artist. Defaults to a single random album, since an artist must have at least one.
+ /// The created domain aggregate root.
+ public Artist Create(
+ LibraryId? libraryId = null,
+ string? name = null,
+ Optional? website = null,
+ Optional? musicBrainzArtistId = null,
+ List? contributors = null,
+ List? albums = null)
+ {
+ Result artistResult = Artist.Create(
+ libraryId ?? _libraryIdFixture.Create(),
+ name ?? _faker.Name.FullName(),
+ website ?? Optional.Some(_faker.Internet.Url()),
+ musicBrainzArtistId ?? Optional.Some(_musicBrainzIdFixture.Create()),
+ contributors ?? [.. Enumerable.Range(0, _faker.Random.Int(1, 3)).Select(_ => _musicMediaContributorFixture.Create())],
+ albums ?? [_albumFixture.Create()]);
+
+ if (artistResult.IsFailure)
+ throw new InvalidOperationException("Failed to create Artist: " + string.Join(", ", artistResult.Errors));
+ return artistResult.Value;
+ }
+
+ ///
+ /// Creates multiple instances with randomized test data.
+ ///
+ /// Number of instances to create.
+ /// List of configured instances.
+ public List CreateMany(int count = 3)
+ {
+ return [.. Enumerable.Range(0, count).Select(_ => Create())];
+ }
+}
diff --git a/tests/Common/Lumina.Domain.Fixtures/Core/BoundedContexts/AudioLibraryBoundedContext/MusicLibraryAggregate/Entities/AlbumFixture.cs b/tests/Common/Lumina.Domain.Fixtures/Core/BoundedContexts/AudioLibraryBoundedContext/MusicLibraryAggregate/Entities/AlbumFixture.cs
new file mode 100644
index 00000000..d161f7b0
--- /dev/null
+++ b/tests/Common/Lumina.Domain.Fixtures/Core/BoundedContexts/AudioLibraryBoundedContext/MusicLibraryAggregate/Entities/AlbumFixture.cs
@@ -0,0 +1,83 @@
+#region ========================================================================= USING =====================================================================================
+using Bogus;
+using Lumina.Domain.Common.Primitives;
+using Lumina.Domain.Core.BoundedContexts.AudioLibraryBoundedContext.Common.ValueObjects;
+using Lumina.Domain.Core.BoundedContexts.AudioLibraryBoundedContext.MusicLibraryAggregate.Entities;
+using Lumina.Domain.Core.BoundedContexts.AudioLibraryBoundedContext.MusicLibraryAggregate.ValueObjects;
+using Lumina.Domain.Fixtures.Core.BoundedContexts.AudioLibraryBoundedContext.Common.ValueObjects;
+using Lumina.Domain.Fixtures.Core.BoundedContexts.AudioLibraryBoundedContext.MusicLibraryAggregate.ValueObjects;
+using Lumina.Domain.SharedKernel.Common.Enums.AudioLibrary;
+using System;
+using System.Collections.Generic;
+using System.Diagnostics.CodeAnalysis;
+using System.Linq;
+#endregion
+
+namespace Lumina.Domain.Fixtures.Core.BoundedContexts.AudioLibraryBoundedContext.MusicLibraryAggregate.Entities;
+
+///
+/// Fixture class for the domain entity.
+///
+[ExcludeFromCodeCoverage]
+public class AlbumFixture
+{
+ private readonly Faker _faker = new();
+ private readonly AlbumMetadataFixture _albumMetadataFixture = new();
+ private readonly BarcodeFixture _barcodeFixture = new();
+ private readonly MusicBrainzIdFixture _musicBrainzIdFixture = new();
+ private readonly MusicMediaContributorFixture _musicMediaContributorFixture = new();
+ private readonly AudioRatingFixture _audioRatingFixture = new();
+
+ ///
+ /// Creates a random valid domain entity.
+ ///
+ /// Optional. The album metadata of the album.
+ /// Optional. The physical or digital medium of the album.
+ /// Optional. The barcode of the album.
+ /// Optional. The catalog number of the album.
+ /// Optional. The MusicBrainz identifier of the release.
+ /// Optional. The MusicBrainz identifier of the release group.
+ /// Optional. The MusicBrainz identifier of the release artist.
+ /// Optional. The media contributors of the album.
+ /// Optional. The ratings of the album.
+ /// Optional. The tracks of the album. Defaults to an empty list so callers can control the initial tracks.
+ /// The created domain entity.
+ public Album Create(
+ AlbumMetadata? metadata = null,
+ Optional? mediaFormat = null,
+ Optional? barcode = null,
+ Optional? catalogNumber = null,
+ Optional? musicBrainzReleaseId = null,
+ Optional? musicBrainzReleaseGroupId = null,
+ Optional? musicBrainzReleaseArtistId = null,
+ List? contributors = null,
+ List? ratings = null,
+ List