1
0
mirror of https://github.com/Radarr/Radarr.git synced 2024-11-10 04:52:42 +01:00
Radarr/NzbDrone.Core.Test/QualityTest.cs

128 lines
3.6 KiB
C#
Raw Normal View History

2011-06-23 08:56:17 +02:00
using FluentAssertions;
using NUnit.Framework;
2011-05-28 21:23:35 +02:00
using NzbDrone.Core.Model;
using NzbDrone.Core.Repository.Quality;
using NzbDrone.Core.Test.Framework;
2011-05-28 21:23:35 +02:00
namespace NzbDrone.Core.Test
{
[TestFixture]
// ReSharper disable InconsistentNaming
2011-11-13 08:27:16 +01:00
public class QualityTest : CoreTest
2011-05-28 21:23:35 +02:00
{
[Test]
public void Icomparer_greater_test()
{
var first = new Quality(QualityTypes.DVD, true);
var second = new Quality(QualityTypes.Bluray1080p, true);
second.Should().BeGreaterThan(first);
2011-05-28 21:23:35 +02:00
}
[Test]
public void Icomparer_greater_proper()
{
var first = new Quality(QualityTypes.Bluray1080p, false);
var second = new Quality(QualityTypes.Bluray1080p, true);
second.Should().BeGreaterThan(first);
2011-05-28 21:23:35 +02:00
}
[Test]
public void Icomparer_lesser()
{
var first = new Quality(QualityTypes.DVD, true);
var second = new Quality(QualityTypes.Bluray1080p, true);
first.Should().BeLessThan(second);
2011-05-28 21:23:35 +02:00
}
[Test]
public void Icomparer_lesser_proper()
{
var first = new Quality(QualityTypes.DVD, false);
var second = new Quality(QualityTypes.DVD, true);
first.Should().BeLessThan(second);
2011-05-28 21:23:35 +02:00
}
[Test]
public void equal_operand()
{
var first = new Quality(QualityTypes.Bluray1080p, true);
var second = new Quality(QualityTypes.Bluray1080p, true);
2011-06-23 08:56:17 +02:00
(first == second).Should().BeTrue();
(first >= second).Should().BeTrue();
(first <= second).Should().BeTrue();
2011-05-28 21:23:35 +02:00
}
[Test]
public void equal_operand_false()
{
var first = new Quality(QualityTypes.Bluray1080p, true);
var second = new Quality(QualityTypes.Unknown, true);
2011-06-23 08:56:17 +02:00
(first == second).Should().BeFalse();
2011-05-28 21:23:35 +02:00
}
[Test]
public void equal_operand_false_proper()
{
var first = new Quality(QualityTypes.Bluray1080p, true);
var second = new Quality(QualityTypes.Bluray1080p, false);
2011-06-23 08:56:17 +02:00
(first == second).Should().BeFalse();
2011-05-28 21:23:35 +02:00
}
[Test]
public void not_equal_operand()
{
var first = new Quality(QualityTypes.Bluray1080p, true);
var second = new Quality(QualityTypes.Bluray1080p, true);
(first != second).Should().BeFalse();
2011-05-28 21:23:35 +02:00
}
[Test]
public void not_equal_operand_false()
{
var first = new Quality(QualityTypes.Bluray1080p, true);
var second = new Quality(QualityTypes.Unknown, true);
2011-06-23 08:56:17 +02:00
(first != second).Should().BeTrue();
2011-05-28 21:23:35 +02:00
}
[Test]
public void not_equal_operand_false_proper()
{
var first = new Quality(QualityTypes.Bluray1080p, true);
var second = new Quality(QualityTypes.Bluray1080p, false);
2011-06-23 08:56:17 +02:00
(first != second).Should().BeTrue();
2011-05-28 21:23:35 +02:00
}
[Test]
public void greater_operand()
{
var first = new Quality(QualityTypes.DVD, true);
var second = new Quality(QualityTypes.Bluray1080p, true);
2011-06-23 08:56:17 +02:00
(first < second).Should().BeTrue();
(first <= second).Should().BeTrue();
2011-05-28 21:23:35 +02:00
}
[Test]
public void lesser_operand()
{
var first = new Quality(QualityTypes.DVD, true);
var second = new Quality(QualityTypes.Bluray1080p, true);
2011-06-23 08:56:17 +02:00
(second > first).Should().BeTrue();
(second >= first).Should().BeTrue();
2011-05-28 21:23:35 +02:00
}
}
}