2011-05-28 21:23:35 +02:00
|
|
|
|
using System;
|
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
using System.Text;
|
2011-06-02 23:06:46 +02:00
|
|
|
|
using FluentAssertions;
|
|
|
|
|
using NUnit.Framework;
|
2011-05-28 21:23:35 +02:00
|
|
|
|
using NzbDrone.Core.Model;
|
|
|
|
|
using NzbDrone.Core.Repository.Quality;
|
|
|
|
|
|
|
|
|
|
namespace NzbDrone.Core.Test
|
|
|
|
|
{
|
|
|
|
|
[TestFixture]
|
|
|
|
|
// ReSharper disable InconsistentNaming
|
|
|
|
|
public class QualityTest
|
|
|
|
|
{
|
|
|
|
|
[Test]
|
2011-06-02 23:06:46 +02:00
|
|
|
|
[Ignore("No supported asserts are available")]
|
2011-05-28 21:23:35 +02:00
|
|
|
|
public void Icomparer_greater_test()
|
|
|
|
|
{
|
|
|
|
|
var first = new Quality(QualityTypes.DVD, true);
|
|
|
|
|
var second = new Quality(QualityTypes.Bluray1080p, true);
|
|
|
|
|
|
2011-06-02 23:06:46 +02:00
|
|
|
|
//Assert.GreaterThan(second, first);
|
2011-05-28 21:23:35 +02:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
[Test]
|
2011-06-02 23:06:46 +02:00
|
|
|
|
[Ignore("No supported asserts are available")]
|
2011-05-28 21:23:35 +02:00
|
|
|
|
public void Icomparer_greater_proper()
|
|
|
|
|
{
|
|
|
|
|
var first = new Quality(QualityTypes.Bluray1080p, false);
|
|
|
|
|
var second = new Quality(QualityTypes.Bluray1080p, true);
|
|
|
|
|
|
2011-06-02 23:06:46 +02:00
|
|
|
|
//Assert.GreaterThan(second, first);
|
2011-05-28 21:23:35 +02:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
[Test]
|
2011-06-02 23:06:46 +02:00
|
|
|
|
[Ignore("No supported asserts are available")]
|
2011-05-28 21:23:35 +02:00
|
|
|
|
public void Icomparer_lesser()
|
|
|
|
|
{
|
|
|
|
|
var first = new Quality(QualityTypes.DVD, true);
|
|
|
|
|
var second = new Quality(QualityTypes.Bluray1080p, true);
|
|
|
|
|
|
2011-06-02 23:06:46 +02:00
|
|
|
|
//Assert.LessThan(first, second);
|
2011-05-28 21:23:35 +02:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
[Test]
|
2011-06-02 23:06:46 +02:00
|
|
|
|
[Ignore("No supported asserts are available")]
|
2011-05-28 21:23:35 +02:00
|
|
|
|
public void Icomparer_lesser_proper()
|
|
|
|
|
{
|
|
|
|
|
var first = new Quality(QualityTypes.DVD, false);
|
|
|
|
|
var second = new Quality(QualityTypes.DVD, true);
|
|
|
|
|
|
2011-06-02 23:06:46 +02:00
|
|
|
|
//Assert.LessThan(first, 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);
|
|
|
|
|
|
|
|
|
|
Assert.IsTrue(first == second);
|
|
|
|
|
Assert.IsTrue(first >= second);
|
|
|
|
|
Assert.IsTrue(first <= second);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
[Test]
|
|
|
|
|
public void equal_operand_false()
|
|
|
|
|
{
|
|
|
|
|
var first = new Quality(QualityTypes.Bluray1080p, true);
|
|
|
|
|
var second = new Quality(QualityTypes.Unknown, true);
|
|
|
|
|
|
|
|
|
|
Assert.IsFalse(first == second);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
[Test]
|
|
|
|
|
public void equal_operand_false_proper()
|
|
|
|
|
{
|
|
|
|
|
var first = new Quality(QualityTypes.Bluray1080p, true);
|
|
|
|
|
var second = new Quality(QualityTypes.Bluray1080p, false);
|
|
|
|
|
|
|
|
|
|
Assert.IsFalse(first == second);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
[Test]
|
|
|
|
|
public void not_equal_operand()
|
|
|
|
|
{
|
|
|
|
|
var first = new Quality(QualityTypes.Bluray1080p, true);
|
|
|
|
|
var second = new Quality(QualityTypes.Bluray1080p, true);
|
|
|
|
|
|
|
|
|
|
Assert.IsFalse(first != second);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
[Test]
|
|
|
|
|
public void not_equal_operand_false()
|
|
|
|
|
{
|
|
|
|
|
var first = new Quality(QualityTypes.Bluray1080p, true);
|
|
|
|
|
var second = new Quality(QualityTypes.Unknown, true);
|
|
|
|
|
|
|
|
|
|
Assert.IsTrue(first != second);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
[Test]
|
|
|
|
|
public void not_equal_operand_false_proper()
|
|
|
|
|
{
|
|
|
|
|
var first = new Quality(QualityTypes.Bluray1080p, true);
|
|
|
|
|
var second = new Quality(QualityTypes.Bluray1080p, false);
|
|
|
|
|
|
|
|
|
|
Assert.IsTrue(first != second);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
[Test]
|
|
|
|
|
public void greater_operand()
|
|
|
|
|
{
|
|
|
|
|
var first = new Quality(QualityTypes.DVD, true);
|
|
|
|
|
var second = new Quality(QualityTypes.Bluray1080p, true);
|
|
|
|
|
|
|
|
|
|
Assert.IsTrue(first < second);
|
|
|
|
|
Assert.IsTrue(first <= second);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
[Test]
|
|
|
|
|
public void lesser_operand()
|
|
|
|
|
{
|
|
|
|
|
var first = new Quality(QualityTypes.DVD, true);
|
|
|
|
|
var second = new Quality(QualityTypes.Bluray1080p, true);
|
|
|
|
|
|
|
|
|
|
Assert.IsTrue(second > first);
|
|
|
|
|
Assert.IsTrue(second >= first);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
}
|