2013-03-05 04:47:51 +03:00
|
|
|
using FizzWare.NBuilder;
|
|
|
|
using FluentAssertions;
|
|
|
|
using NUnit.Framework;
|
|
|
|
using NzbDrone.Core.MediaFiles;
|
2013-04-01 09:22:16 +03:00
|
|
|
using NzbDrone.Core.Qualities;
|
2013-03-05 04:47:51 +03:00
|
|
|
using NzbDrone.Core.Test.Framework;
|
2013-04-01 09:22:16 +03:00
|
|
|
using NzbDrone.Core.Tv;
|
2013-03-05 04:47:51 +03:00
|
|
|
|
2013-09-10 20:54:59 +03:00
|
|
|
namespace NzbDrone.Core.Test.MediaFiles
|
2013-03-05 04:47:51 +03:00
|
|
|
{
|
|
|
|
[TestFixture]
|
2013-03-24 07:16:00 +03:00
|
|
|
public class MediaFileRepositoryFixture : DbTest<MediaFileRepository, EpisodeFile>
|
2013-03-05 04:47:51 +03:00
|
|
|
{
|
|
|
|
[Test]
|
|
|
|
public void get_files_by_series()
|
|
|
|
{
|
|
|
|
var files = Builder<EpisodeFile>.CreateListOfSize(10)
|
|
|
|
.All()
|
|
|
|
.With(c => c.Id = 0)
|
2013-04-01 09:22:16 +03:00
|
|
|
.With(c => c.Quality =new QualityModel(Quality.Bluray720p))
|
2013-03-05 04:47:51 +03:00
|
|
|
.Random(4)
|
|
|
|
.With(s => s.SeriesId = 12)
|
2013-04-01 09:22:16 +03:00
|
|
|
.BuildListOfNew();
|
2013-03-05 04:47:51 +03:00
|
|
|
|
|
|
|
|
|
|
|
Db.InsertMany(files);
|
|
|
|
|
|
|
|
var seriesFiles = Subject.GetFilesBySeries(12);
|
|
|
|
|
|
|
|
seriesFiles.Should().HaveCount(4);
|
|
|
|
seriesFiles.Should().OnlyContain(c => c.SeriesId == 12);
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|