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