mirror of
https://github.com/Lidarr/Lidarr
synced 2026-02-05 14:23:22 +01:00
* Preliminary Work for Extras for Music * DB Migration for ExtraFiles, Other Cleanup * More Extras Work, Add Album Metadata Type * Update Housekeeps for Music Extras * Fix HouseKeeper and add new Tests * Final round of Cleanup
34 lines
926 B
C#
34 lines
926 B
C#
using FizzWare.NBuilder;
|
|
using FluentAssertions;
|
|
using NUnit.Framework;
|
|
using NzbDrone.Core.MediaFiles;
|
|
using NzbDrone.Core.Qualities;
|
|
using NzbDrone.Core.Test.Framework;
|
|
|
|
namespace NzbDrone.Core.Test.MediaFiles
|
|
{
|
|
[TestFixture]
|
|
public class MediaFileRepositoryFixture : DbTest<MediaFileRepository, TrackFile>
|
|
{
|
|
[Test]
|
|
public void get_files_by_artist()
|
|
{
|
|
var files = Builder<TrackFile>.CreateListOfSize(10)
|
|
.All()
|
|
.With(c => c.Id = 0)
|
|
.With(c => c.Quality =new QualityModel(Quality.MP3_192))
|
|
.Random(4)
|
|
.With(s => s.ArtistId = 12)
|
|
.BuildListOfNew();
|
|
|
|
|
|
Db.InsertMany(files);
|
|
|
|
var artistFiles = Subject.GetFilesByArtist(12);
|
|
|
|
artistFiles.Should().HaveCount(4);
|
|
artistFiles.Should().OnlyContain(c => c.ArtistId == 12);
|
|
|
|
}
|
|
}
|
|
}
|