parent
d6d524e624
commit
016e360d1a
@ -0,0 +1,39 @@
|
||||
using System.Collections.Generic;
|
||||
using FluentAssertions;
|
||||
using NUnit.Framework;
|
||||
using NzbDrone.Core.Qualities;
|
||||
using NzbDrone.Core.Test.Framework;
|
||||
|
||||
namespace NzbDrone.Core.Test.Qualities
|
||||
{
|
||||
[TestFixture]
|
||||
|
||||
public class QualityProfileRepositoryFixture : DbTest<QualityProfileRepository, QualityProfile>
|
||||
{
|
||||
[Test]
|
||||
public void should_be_able_to_read_and_write()
|
||||
{
|
||||
var profile = new QualityProfile
|
||||
{
|
||||
Allowed = new List<Quality>
|
||||
{
|
||||
Quality.Bluray1080p,
|
||||
Quality.DVD,
|
||||
Quality.HDTV720p
|
||||
},
|
||||
|
||||
Cutoff = Quality.Bluray1080p,
|
||||
Name = "TestProfile"
|
||||
};
|
||||
|
||||
Subject.Insert(profile);
|
||||
|
||||
StoredModel.Name.Should().Be(profile.Name);
|
||||
StoredModel.Cutoff.Should().Be(profile.Cutoff);
|
||||
|
||||
StoredModel.Allowed.Should().BeEquivalentTo(profile.Allowed);
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,46 @@
|
||||
using System.Collections.Generic;
|
||||
using FizzWare.NBuilder;
|
||||
using FluentAssertions;
|
||||
using NUnit.Framework;
|
||||
using NzbDrone.Core.Qualities;
|
||||
using NzbDrone.Core.Test.Framework;
|
||||
using NzbDrone.Core.Tv;
|
||||
using NzbDrone.Test.Common;
|
||||
|
||||
namespace NzbDrone.Core.Test.TvTests.SeriesRepositoryTests
|
||||
{
|
||||
[TestFixture]
|
||||
|
||||
public class SeriesRepositoryFixture : DbTest<SeriesRepository, Series>
|
||||
{
|
||||
[Test]
|
||||
public void should_lazyload_quality_profile()
|
||||
{
|
||||
var profile = new QualityProfile
|
||||
{
|
||||
Allowed = new List<Quality>
|
||||
{
|
||||
Quality.Bluray1080p,
|
||||
Quality.DVD,
|
||||
Quality.HDTV720p
|
||||
},
|
||||
|
||||
Cutoff = Quality.Bluray1080p,
|
||||
Name = "TestProfile"
|
||||
};
|
||||
|
||||
|
||||
Mocker.Resolve<QualityProfileRepository>().Insert(profile);
|
||||
|
||||
var series = Builder<Series>.CreateNew().BuildNew();
|
||||
series.QualityProfileId = profile.Id;
|
||||
|
||||
Subject.Insert(series);
|
||||
|
||||
|
||||
StoredModel.QualityProfile.Should().NotBeNull();
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Reference in new issue