1
0
mirror of https://github.com/Radarr/Radarr.git synced 2026-04-22 22:15:17 -04:00

Added: A Huge Cleanup of old Series Code. (Let's pray nothing breaks :P) (#2589)

This commit is contained in:
Qstick
2018-03-14 16:41:36 -04:00
committed by Leonardo Galli
parent 8a6d67a6d7
commit 25e10e26e3
551 changed files with 2835 additions and 18867 deletions
@@ -0,0 +1,71 @@
using System.Collections.Generic;
using System.Linq;
using FluentAssertions;
using NUnit.Framework;
using NzbDrone.Core.MetadataSource;
using NzbDrone.Core.Test.Framework;
using NzbDrone.Core.Movies;
namespace NzbDrone.Core.Test.MetadataSource
{
[TestFixture]
public class SearchMovieComparerFixture : CoreTest
{
private List<Movie> _series;
[SetUp]
public void Setup()
{
_series = new List<Movie>();
}
private void WithSeries(string title)
{
_series.Add(new Movie { Title = title });
}
[Test]
public void should_prefer_the_walking_dead_over_talking_dead_when_searching_for_the_walking_dead()
{
WithSeries("Talking Dead");
WithSeries("The Walking Dead");
_series.Sort(new SearchMovieComparer("the walking dead"));
_series.First().Title.Should().Be("The Walking Dead");
}
[Test]
public void should_prefer_the_walking_dead_over_talking_dead_when_searching_for_walking_dead()
{
WithSeries("Talking Dead");
WithSeries("The Walking Dead");
_series.Sort(new SearchMovieComparer("walking dead"));
_series.First().Title.Should().Be("The Walking Dead");
}
[Test]
public void should_prefer_blacklist_over_the_blacklist_when_searching_for_blacklist()
{
WithSeries("The Blacklist");
WithSeries("Blacklist");
_series.Sort(new SearchMovieComparer("blacklist"));
_series.First().Title.Should().Be("Blacklist");
}
[Test]
public void should_prefer_the_blacklist_over_blacklist_when_searching_for_the_blacklist()
{
WithSeries("Blacklist");
WithSeries("The Blacklist");
_series.Sort(new SearchMovieComparer("the blacklist"));
_series.First().Title.Should().Be("The Blacklist");
}
}
}