mirror of
https://github.com/Radarr/Radarr.git
synced 2026-04-25 22:37:27 -04:00
Swap to dapper and system.text.json for database backend
This commit is contained in:
+7
-8
@@ -1,7 +1,6 @@
|
||||
using System.Collections.Generic;
|
||||
using FizzWare.NBuilder;
|
||||
using FluentAssertions;
|
||||
using Marr.Data;
|
||||
using NUnit.Framework;
|
||||
using NzbDrone.Core.DecisionEngine.Specifications;
|
||||
using NzbDrone.Core.Parser.Model;
|
||||
@@ -33,7 +32,7 @@ namespace NzbDrone.Core.Test.DecisionEngineTests
|
||||
|
||||
|
||||
var fakeSeries = Builder<Movie>.CreateNew()
|
||||
.With(c => c.Profile = (LazyLoaded<Profile>)new Profile { Cutoff = Quality.Bluray1080p.Id })
|
||||
.With(c => c.Profile = new Profile { Cutoff = Quality.Bluray1080p.Id })
|
||||
.Build();
|
||||
|
||||
remoteMovie = new RemoteMovie
|
||||
@@ -49,7 +48,7 @@ namespace NzbDrone.Core.Test.DecisionEngineTests
|
||||
public void should_allow_if_format_is_defined_in_profile()
|
||||
{
|
||||
remoteMovie.ParsedMovieInfo.Quality.CustomFormats = new List<CustomFormats.CustomFormat> {_format1};
|
||||
remoteMovie.Movie.Profile.Value.FormatItems = CustomFormatsFixture.GetSampleFormatItems(_format1.Name);
|
||||
remoteMovie.Movie.Profile.FormatItems = CustomFormatsFixture.GetSampleFormatItems(_format1.Name);
|
||||
|
||||
Subject.IsSatisfiedBy(remoteMovie, null).Accepted.Should().BeTrue();
|
||||
}
|
||||
@@ -58,7 +57,7 @@ namespace NzbDrone.Core.Test.DecisionEngineTests
|
||||
public void should_deny_if_format_is_defined_in_profile()
|
||||
{
|
||||
remoteMovie.ParsedMovieInfo.Quality.CustomFormats = new List<CustomFormats.CustomFormat> {_format2};
|
||||
remoteMovie.Movie.Profile.Value.FormatItems = CustomFormatsFixture.GetSampleFormatItems(_format1.Name);
|
||||
remoteMovie.Movie.Profile.FormatItems = CustomFormatsFixture.GetSampleFormatItems(_format1.Name);
|
||||
|
||||
Subject.IsSatisfiedBy(remoteMovie, null).Accepted.Should().BeFalse();
|
||||
}
|
||||
@@ -67,7 +66,7 @@ namespace NzbDrone.Core.Test.DecisionEngineTests
|
||||
public void should_deny_if_one_format_is_defined_in_profile()
|
||||
{
|
||||
remoteMovie.ParsedMovieInfo.Quality.CustomFormats = new List<CustomFormats.CustomFormat> {_format2, _format1};
|
||||
remoteMovie.Movie.Profile.Value.FormatItems = CustomFormatsFixture.GetSampleFormatItems(_format1.Name);
|
||||
remoteMovie.Movie.Profile.FormatItems = CustomFormatsFixture.GetSampleFormatItems(_format1.Name);
|
||||
|
||||
Subject.IsSatisfiedBy(remoteMovie, null).Accepted.Should().BeFalse();
|
||||
}
|
||||
@@ -76,7 +75,7 @@ namespace NzbDrone.Core.Test.DecisionEngineTests
|
||||
public void should_allow_if_all_format_is_defined_in_profile()
|
||||
{
|
||||
remoteMovie.ParsedMovieInfo.Quality.CustomFormats = new List<CustomFormats.CustomFormat> {_format2, _format1};
|
||||
remoteMovie.Movie.Profile.Value.FormatItems = CustomFormatsFixture.GetSampleFormatItems(_format1.Name, _format2.Name);
|
||||
remoteMovie.Movie.Profile.FormatItems = CustomFormatsFixture.GetSampleFormatItems(_format1.Name, _format2.Name);
|
||||
|
||||
Subject.IsSatisfiedBy(remoteMovie, null).Accepted.Should().BeTrue();
|
||||
}
|
||||
@@ -85,7 +84,7 @@ namespace NzbDrone.Core.Test.DecisionEngineTests
|
||||
public void should_deny_if_no_format_was_parsed_and_none_not_in_profile()
|
||||
{
|
||||
remoteMovie.ParsedMovieInfo.Quality.CustomFormats = new List<CustomFormats.CustomFormat> {};
|
||||
remoteMovie.Movie.Profile.Value.FormatItems = CustomFormatsFixture.GetSampleFormatItems(_format1.Name, _format2.Name);
|
||||
remoteMovie.Movie.Profile.FormatItems = CustomFormatsFixture.GetSampleFormatItems(_format1.Name, _format2.Name);
|
||||
|
||||
Subject.IsSatisfiedBy(remoteMovie, null).Accepted.Should().BeFalse();
|
||||
}
|
||||
@@ -94,7 +93,7 @@ namespace NzbDrone.Core.Test.DecisionEngineTests
|
||||
public void should_allow_if_no_format_was_parsed_and_none_in_profile()
|
||||
{
|
||||
remoteMovie.ParsedMovieInfo.Quality.CustomFormats = new List<CustomFormats.CustomFormat> {};
|
||||
remoteMovie.Movie.Profile.Value.FormatItems = CustomFormatsFixture.GetSampleFormatItems(CustomFormats.CustomFormat.None.Name, _format1.Name, _format2.Name);
|
||||
remoteMovie.Movie.Profile.FormatItems = CustomFormatsFixture.GetSampleFormatItems(CustomFormats.CustomFormat.None.Name, _format1.Name, _format2.Name);
|
||||
|
||||
Subject.IsSatisfiedBy(remoteMovie, null).Accepted.Should().BeTrue();
|
||||
}
|
||||
|
||||
@@ -1,9 +1,7 @@
|
||||
using System.Collections.Generic;
|
||||
using FluentAssertions;
|
||||
using Marr.Data;
|
||||
using NUnit.Framework;
|
||||
using NzbDrone.Core.DecisionEngine.Specifications;
|
||||
using NzbDrone.Core.Parser;
|
||||
using NzbDrone.Core.Parser.Model;
|
||||
using NzbDrone.Core.Profiles;
|
||||
using NzbDrone.Core.Test.Framework;
|
||||
@@ -29,10 +27,10 @@ namespace NzbDrone.Core.Test.DecisionEngineTests
|
||||
},
|
||||
Movie = new Movie
|
||||
{
|
||||
Profile = new LazyLoaded<Profile>(new Profile
|
||||
{
|
||||
Language = Language.English
|
||||
})
|
||||
Profile = new Profile
|
||||
{
|
||||
Language = Language.English
|
||||
}
|
||||
}
|
||||
};
|
||||
}
|
||||
@@ -66,10 +64,10 @@ namespace NzbDrone.Core.Test.DecisionEngineTests
|
||||
[Test]
|
||||
public void should_return_true_if_allowed_language_any()
|
||||
{
|
||||
_remoteMovie.Movie.Profile = new LazyLoaded<Profile>(new Profile
|
||||
_remoteMovie.Movie.Profile = new Profile
|
||||
{
|
||||
Language = Language.Any
|
||||
});
|
||||
};
|
||||
|
||||
WithGermanRelease();
|
||||
|
||||
|
||||
+3
-4
@@ -1,6 +1,5 @@
|
||||
using FizzWare.NBuilder;
|
||||
using FluentAssertions;
|
||||
using Marr.Data;
|
||||
using NUnit.Framework;
|
||||
using NzbDrone.Core.DecisionEngine.Specifications;
|
||||
using NzbDrone.Core.Parser.Model;
|
||||
@@ -35,7 +34,7 @@ namespace NzbDrone.Core.Test.DecisionEngineTests
|
||||
public void Setup()
|
||||
{
|
||||
var fakeSeries = Builder<Movie>.CreateNew()
|
||||
.With(c => c.Profile = (LazyLoaded<Profile>)new Profile { Cutoff = Quality.Bluray1080p.Id })
|
||||
.With(c => c.Profile = new Profile { Cutoff = Quality.Bluray1080p.Id })
|
||||
.Build();
|
||||
|
||||
remoteMovie = new RemoteMovie
|
||||
@@ -49,7 +48,7 @@ namespace NzbDrone.Core.Test.DecisionEngineTests
|
||||
public void should_allow_if_quality_is_defined_in_profile(Quality qualityType)
|
||||
{
|
||||
remoteMovie.ParsedMovieInfo.Quality.Quality = qualityType;
|
||||
remoteMovie.Movie.Profile.Value.Items = Qualities.QualityFixture.GetDefaultQualities(Quality.DVD, Quality.HDTV720p, Quality.Bluray1080p);
|
||||
remoteMovie.Movie.Profile.Items = Qualities.QualityFixture.GetDefaultQualities(Quality.DVD, Quality.HDTV720p, Quality.Bluray1080p);
|
||||
|
||||
Subject.IsSatisfiedBy(remoteMovie, null).Accepted.Should().BeTrue();
|
||||
}
|
||||
@@ -58,7 +57,7 @@ namespace NzbDrone.Core.Test.DecisionEngineTests
|
||||
public void should_not_allow_if_quality_is_not_defined_in_profile(Quality qualityType)
|
||||
{
|
||||
remoteMovie.ParsedMovieInfo.Quality.Quality = qualityType;
|
||||
remoteMovie.Movie.Profile.Value.Items = Qualities.QualityFixture.GetDefaultQualities(Quality.DVD, Quality.HDTV720p, Quality.Bluray1080p);
|
||||
remoteMovie.Movie.Profile.Items = Qualities.QualityFixture.GetDefaultQualities(Quality.DVD, Quality.HDTV720p, Quality.Bluray1080p);
|
||||
|
||||
Subject.IsSatisfiedBy(remoteMovie, null).Accepted.Should().BeFalse();
|
||||
}
|
||||
|
||||
@@ -83,7 +83,7 @@ namespace NzbDrone.Core.Test.DecisionEngineTests
|
||||
[Test]
|
||||
public void should_return_true_when_quality_in_queue_is_lower()
|
||||
{
|
||||
_movie.Profile.Value.Cutoff = Quality.Bluray1080p.Id;
|
||||
_movie.Profile.Cutoff = Quality.Bluray1080p.Id;
|
||||
|
||||
var remoteMovie = Builder<RemoteMovie>.CreateNew()
|
||||
.With(r => r.Movie = _movie)
|
||||
@@ -115,7 +115,7 @@ namespace NzbDrone.Core.Test.DecisionEngineTests
|
||||
[Test]
|
||||
public void should_return_false_when_quality_in_queue_is_better()
|
||||
{
|
||||
_movie.Profile.Value.Cutoff = Quality.Bluray1080p.Id;
|
||||
_movie.Profile.Cutoff = Quality.Bluray1080p.Id;
|
||||
|
||||
var remoteMovie = Builder<RemoteMovie>.CreateNew()
|
||||
.With(r => r.Movie = _movie)
|
||||
@@ -132,7 +132,7 @@ namespace NzbDrone.Core.Test.DecisionEngineTests
|
||||
[Test]
|
||||
public void should_return_false_if_quality_in_queue_meets_cutoff()
|
||||
{
|
||||
_movie.Profile.Value.Cutoff = _remoteMovie.ParsedMovieInfo.Quality.Quality.Id;
|
||||
_movie.Profile.Cutoff = _remoteMovie.ParsedMovieInfo.Quality.Quality.Id;
|
||||
|
||||
var remoteMovie = Builder<RemoteMovie>.CreateNew()
|
||||
.With(r => r.Movie = _movie)
|
||||
@@ -151,8 +151,8 @@ namespace NzbDrone.Core.Test.DecisionEngineTests
|
||||
[Test]
|
||||
public void should_return_false_when_quality_is_better_and_upgrade_allowed_is_false_for_quality_profile()
|
||||
{
|
||||
_movie.Profile.Value.Cutoff = Quality.Bluray1080p.Id;
|
||||
_movie.Profile.Value.UpgradeAllowed = false;
|
||||
_movie.Profile.Cutoff = Quality.Bluray1080p.Id;
|
||||
_movie.Profile.UpgradeAllowed = false;
|
||||
|
||||
var remoteMovie = Builder<RemoteMovie>.CreateNew()
|
||||
.With(r => r.Movie = _movie)
|
||||
|
||||
@@ -1,9 +1,7 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using FizzWare.NBuilder;
|
||||
using FluentAssertions;
|
||||
using Marr.Data;
|
||||
using Moq;
|
||||
using NUnit.Framework;
|
||||
using NzbDrone.Core.DecisionEngine.Specifications;
|
||||
@@ -78,7 +76,7 @@ namespace NzbDrone.Core.Test.DecisionEngineTests.RssSync
|
||||
// Quality = quality
|
||||
// });
|
||||
|
||||
_remoteEpisode.Movie.MovieFile = new LazyLoaded<MovieFile>(new MovieFile { Quality = quality });
|
||||
_remoteEpisode.Movie.MovieFile = new MovieFile { Quality = quality };
|
||||
}
|
||||
|
||||
private void GivenUpgradeForExistingFile()
|
||||
|
||||
Reference in New Issue
Block a user