mirror of
https://dev.azure.com/TeilRad/sharee.bike%20App/_git/Code
synced 2024-11-15 22:56:37 +01:00
74 lines
2 KiB
C#
74 lines
2 KiB
C#
using NUnit.Framework;
|
|
using System;
|
|
using TINK.Model;
|
|
using TINK.Model.Map;
|
|
using TINK.Services.CopriApi;
|
|
|
|
namespace TestShareeLib.Services.CopriApi
|
|
{
|
|
[TestFixture]
|
|
public class TestGeneralData
|
|
{
|
|
[Test]
|
|
public void TestCtor()
|
|
{
|
|
Assert.That(
|
|
new GeneralData().MerchantMessage,
|
|
Is.EqualTo(""));
|
|
|
|
Assert.That(
|
|
new GeneralData().ApiVersion,
|
|
Is.EqualTo(new Version(0,0)));
|
|
|
|
Assert.That(
|
|
new GeneralData().InitialMapSpan?.IsValid,
|
|
Is.False,
|
|
"Object not not be null but invalid.");
|
|
}
|
|
|
|
[Test]
|
|
public void TestMessage()
|
|
{
|
|
Assert.That(
|
|
new GeneralData(
|
|
MapSpanFactory.Create(),
|
|
"Hello",
|
|
null,
|
|
new ResourceUrls()).MerchantMessage,
|
|
Is.EqualTo("Hello"));
|
|
}
|
|
|
|
[Test]
|
|
public void TestVersion()
|
|
{
|
|
Assert.That(
|
|
new GeneralData(
|
|
MapSpanFactory.Create(),
|
|
null,
|
|
new Version(1,2),
|
|
new ResourceUrls()).ApiVersion,
|
|
Is.EqualTo(new Version(1, 2)));
|
|
}
|
|
|
|
|
|
[Test]
|
|
public void TestInitialMapSpan()
|
|
{
|
|
Assert.That(
|
|
new GeneralData(
|
|
MapSpanFactory.Create(PositionFactory.Create(0, 8), 15),
|
|
null,
|
|
new Version(1, 2),
|
|
new ResourceUrls()).InitialMapSpan.Center.Longitude,
|
|
Is.EqualTo(8));
|
|
|
|
Assert.That(
|
|
new GeneralData(
|
|
MapSpanFactory.Create(PositionFactory.Create(0, 8), 15),
|
|
null,
|
|
new Version(1, 2),
|
|
new ResourceUrls()).InitialMapSpan.Radius,
|
|
Is.EqualTo(15));
|
|
}
|
|
}
|
|
}
|