1
0
mirror of https://github.com/Radarr/Radarr.git synced 2024-11-09 04:22:30 +01:00
Radarr/NzbDrone.Core.Test/QualityTest.cs
2013-02-15 16:52:46 -08:00

127 lines
3.7 KiB
C#

using FluentAssertions;
using NUnit.Framework;
using NzbDrone.Core.Model;
using NzbDrone.Core.Repository.Quality;
using NzbDrone.Core.Test.Framework;
namespace NzbDrone.Core.Test
{
[TestFixture]
// ReSharper disable InconsistentNaming
public class QualityTest : SqlCeTest
{
[Test]
public void Icomparer_greater_test()
{
var first = new QualityModel(QualityTypes.DVD, true);
var second = new QualityModel(QualityTypes.Bluray1080p, true);
second.Should().BeGreaterThan(first);
}
[Test]
public void Icomparer_greater_proper()
{
var first = new QualityModel(QualityTypes.Bluray1080p, false);
var second = new QualityModel(QualityTypes.Bluray1080p, true);
second.Should().BeGreaterThan(first);
}
[Test]
public void Icomparer_lesser()
{
var first = new QualityModel(QualityTypes.DVD, true);
var second = new QualityModel(QualityTypes.Bluray1080p, true);
first.Should().BeLessThan(second);
}
[Test]
public void Icomparer_lesser_proper()
{
var first = new QualityModel(QualityTypes.DVD, false);
var second = new QualityModel(QualityTypes.DVD, true);
first.Should().BeLessThan(second);
}
[Test]
public void equal_operand()
{
var first = new QualityModel(QualityTypes.Bluray1080p, true);
var second = new QualityModel(QualityTypes.Bluray1080p, true);
(first == second).Should().BeTrue();
(first >= second).Should().BeTrue();
(first <= second).Should().BeTrue();
}
[Test]
public void equal_operand_false()
{
var first = new QualityModel(QualityTypes.Bluray1080p, true);
var second = new QualityModel(QualityTypes.Unknown, true);
(first == second).Should().BeFalse();
}
[Test]
public void equal_operand_false_proper()
{
var first = new QualityModel(QualityTypes.Bluray1080p, true);
var second = new QualityModel(QualityTypes.Bluray1080p, false);
(first == second).Should().BeFalse();
}
[Test]
public void not_equal_operand()
{
var first = new QualityModel(QualityTypes.Bluray1080p, true);
var second = new QualityModel(QualityTypes.Bluray1080p, true);
(first != second).Should().BeFalse();
}
[Test]
public void not_equal_operand_false()
{
var first = new QualityModel(QualityTypes.Bluray1080p, true);
var second = new QualityModel(QualityTypes.Unknown, true);
(first != second).Should().BeTrue();
}
[Test]
public void not_equal_operand_false_proper()
{
var first = new QualityModel(QualityTypes.Bluray1080p, true);
var second = new QualityModel(QualityTypes.Bluray1080p, false);
(first != second).Should().BeTrue();
}
[Test]
public void greater_operand()
{
var first = new QualityModel(QualityTypes.DVD, true);
var second = new QualityModel(QualityTypes.Bluray1080p, true);
(first < second).Should().BeTrue();
(first <= second).Should().BeTrue();
}
[Test]
public void lesser_operand()
{
var first = new QualityModel(QualityTypes.DVD, true);
var second = new QualityModel(QualityTypes.Bluray1080p, true);
(second > first).Should().BeTrue();
(second >= first).Should().BeTrue();
}
}
}