mirror of
https://dev.azure.com/TeilRad/sharee.bike%20App/_git/Code
synced 2024-11-05 10:36:30 +01:00
75 lines
2.2 KiB
C#
75 lines
2.2 KiB
C#
using NUnit.Framework;
|
|
using TINK.Model;
|
|
|
|
namespace TestShareeLib.Model
|
|
{
|
|
[TestFixture]
|
|
public class TestPosition
|
|
{
|
|
[Test]
|
|
public void TestEquals()
|
|
{
|
|
var positonA = PositionFactory.Create(12, 13);
|
|
var positonB = PositionFactory.Create(12, 13);
|
|
|
|
Assert.That(positonA.GetType(), Is.EqualTo(typeof(Position)), "Object under test is not of expected type.");
|
|
Assert.That(positonB.GetType(), Is.EqualTo(typeof(Position)), "Object under test is not of expected type.");
|
|
|
|
Assert.That(
|
|
positonA.Equals(positonB),
|
|
Is.True);
|
|
}
|
|
|
|
[Test]
|
|
public void TestEqualsNotEquaLong()
|
|
{
|
|
var positonA = PositionFactory.Create(12, 13);
|
|
var positonB = PositionFactory.Create(13, 13);
|
|
|
|
Assert.That(positonA.GetType(), Is.EqualTo(typeof(Position)), "Object under test is not of expected type.");
|
|
Assert.That(positonB.GetType(), Is.EqualTo(typeof(Position)), "Object under test is not of expected type.");
|
|
|
|
Assert.That(
|
|
positonA.Equals(positonB),
|
|
Is.False);
|
|
}
|
|
|
|
[Test]
|
|
public void TestEqualsNotEquaLat()
|
|
{
|
|
var positonA = PositionFactory.Create(12, 13);
|
|
var positonB = PositionFactory.Create(12, 12);
|
|
|
|
Assert.That(positonA.GetType(), Is.EqualTo(typeof(Position)), "Object under test is not of expected type.");
|
|
Assert.That(positonB.GetType(), Is.EqualTo(typeof(Position)), "Object under test is not of expected type.");
|
|
|
|
Assert.That(
|
|
positonA.Equals(positonB),
|
|
Is.False);
|
|
}
|
|
|
|
[Test]
|
|
public void TestGetIsValid()
|
|
{
|
|
Assert.That(
|
|
Position.GetIsValid(1, 2),
|
|
Is.True);
|
|
}
|
|
|
|
[Test]
|
|
public void TestGetIsValidInvalidLong()
|
|
{
|
|
Assert.That(
|
|
Position.GetIsValid(double.NaN, 2),
|
|
Is.False);
|
|
}
|
|
|
|
[Test]
|
|
public void TestGetIsValidInvalidLat()
|
|
{
|
|
Assert.That(
|
|
Position.GetIsValid(2, double.NaN),
|
|
Is.False);
|
|
}
|
|
}
|
|
}
|