mirror of
https://dev.azure.com/TeilRad/sharee.bike%20App/_git/Code
synced 2024-11-06 02:56:32 +01:00
49 lines
1.5 KiB
C#
49 lines
1.5 KiB
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using NUnit.Framework;
|
|
using TINK.Model;
|
|
|
|
namespace TestTINKLib.Fixtures.Station
|
|
{
|
|
|
|
[TestFixture]
|
|
public class TestStation
|
|
{
|
|
[Test]
|
|
public void TestConstruct()
|
|
{
|
|
var l_oStation = new TINK.Model.Station.Station("7", new HashSet<string>(new List<string> { "TINK" }).ToList(), PositionFactory.Create(1, 2), "Hallo");
|
|
Assert.AreEqual("7", l_oStation.Id);
|
|
Assert.AreEqual("TINK", string.Join(",", l_oStation.Group));
|
|
Assert.AreEqual(1, l_oStation.Position.Latitude);
|
|
Assert.AreEqual(2, l_oStation.Position.Longitude);
|
|
Assert.AreEqual("Hallo", l_oStation.StationName);
|
|
}
|
|
|
|
[Test]
|
|
public void TestConstruct_InvalidStationName()
|
|
{
|
|
var l_oStation = new TINK.Model.Station.Station("7", new HashSet<string>(new List<string> { "TINK" }).ToList(), PositionFactory.Create(1, 2), null);
|
|
Assert.AreEqual("7", l_oStation.Id);
|
|
Assert.AreEqual("TINK", string.Join(",", l_oStation.Group));
|
|
Assert.AreEqual(1, l_oStation.Position.Latitude);
|
|
Assert.AreEqual(2, l_oStation.Position.Longitude);
|
|
Assert.AreEqual("", l_oStation.StationName);
|
|
}
|
|
|
|
[Test]
|
|
public void TestConstruct_InvalidStationGroup()
|
|
{
|
|
Assert.Throws<ArgumentException>(() => new TINK.Model.Station.Station("7", null, PositionFactory.Create(1, 2), "Hallo"));
|
|
}
|
|
|
|
[Test]
|
|
public void TestConstruct_NoOperator()
|
|
{
|
|
Assert.That(
|
|
new TINK.Model.Station.Station("7", new List<string>(), PositionFactory.Create(1, 2), "Hallo").OperatorData,
|
|
Is.Not.Null);
|
|
}
|
|
}
|
|
}
|