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.
35 lines
956 B
35 lines
956 B
12 years ago
|
using FizzWare.NBuilder;
|
||
|
using FluentAssertions;
|
||
|
using NUnit.Framework;
|
||
|
using NzbDrone.Core.MediaFiles;
|
||
12 years ago
|
using NzbDrone.Core.Qualities;
|
||
12 years ago
|
using NzbDrone.Core.Test.Framework;
|
||
12 years ago
|
using NzbDrone.Core.Tv;
|
||
12 years ago
|
|
||
11 years ago
|
namespace NzbDrone.Core.Test.MediaFiles
|
||
12 years ago
|
{
|
||
|
[TestFixture]
|
||
12 years ago
|
public class MediaFileRepositoryFixture : DbTest<MediaFileRepository, EpisodeFile>
|
||
12 years ago
|
{
|
||
|
[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))
|
||
12 years ago
|
.Random(4)
|
||
|
.With(s => s.SeriesId = 12)
|
||
12 years ago
|
.BuildListOfNew();
|
||
12 years ago
|
|
||
|
|
||
|
Db.InsertMany(files);
|
||
|
|
||
|
var seriesFiles = Subject.GetFilesBySeries(12);
|
||
|
|
||
|
seriesFiles.Should().HaveCount(4);
|
||
|
seriesFiles.Should().OnlyContain(c => c.SeriesId == 12);
|
||
|
|
||
|
}
|
||
|
}
|
||
|
}
|