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.
37 lines
1007 B
37 lines
1007 B
using FizzWare.NBuilder;
|
|
using FluentAssertions;
|
|
using NUnit.Framework;
|
|
using NzbDrone.Common;
|
|
using NzbDrone.Core.MediaFiles;
|
|
using NzbDrone.Core.Qualities;
|
|
using NzbDrone.Core.Test.Framework;
|
|
using NzbDrone.Core.Tv;
|
|
using NzbDrone.Test.Common;
|
|
|
|
namespace NzbDrone.Core.Test.MediaFiles
|
|
{
|
|
[TestFixture]
|
|
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)
|
|
.With(c => c.Quality =new QualityModel(Quality.Bluray720p))
|
|
.Random(4)
|
|
.With(s => s.SeriesId = 12)
|
|
.BuildListOfNew();
|
|
|
|
|
|
Db.InsertMany(files);
|
|
|
|
var seriesFiles = Subject.GetFilesBySeries(12);
|
|
|
|
seriesFiles.Should().HaveCount(4);
|
|
seriesFiles.Should().OnlyContain(c => c.SeriesId == 12);
|
|
|
|
}
|
|
}
|
|
} |