You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Readarr/src/NzbDrone.Core.Test/MediaFiles/MediaFileRepositoryFixture.cs

34 lines
932 B

using FizzWare.NBuilder;
using FluentAssertions;
using NUnit.Framework;
using NzbDrone.Core.MediaFiles;
12 years ago
using NzbDrone.Core.Qualities;
using NzbDrone.Core.Test.Framework;
namespace NzbDrone.Core.Test.MediaFiles
{
[TestFixture]
12 years ago
public class MediaFileRepositoryFixture : DbTest<MediaFileRepository, EpisodeFile>
{
[Test]
public void get_files_by_series()
{
var files = Builder<EpisodeFile>.CreateListOfSize(10)
.All()
.With(c => c.Id = 0)
12 years ago
.With(c => c.Quality =new QualityModel(Quality.Bluray720p))
.Random(4)
.With(s => s.SeriesId = 12)
12 years ago
.BuildListOfNew();
Db.InsertMany(files);
var seriesFiles = Subject.GetFilesBySeries(12);
seriesFiles.Should().HaveCount(4);
seriesFiles.Should().OnlyContain(c => c.SeriesId == 12);
}
}
}