mirror of
https://dev.azure.com/TeilRad/sharee.bike%20App/_git/Code
synced 2025-07-08 12:36:31 +02:00
Version 3.0.381
This commit is contained in:
parent
f963c0a219
commit
3a363acf3a
1525 changed files with 60589 additions and 125098 deletions
58
SharedBusinessLogic.Tests/Model/Station/TestData.cs
Normal file
58
SharedBusinessLogic.Tests/Model/Station/TestData.cs
Normal file
|
@ -0,0 +1,58 @@
|
|||
using NUnit.Framework;
|
||||
|
||||
namespace SharedBusinessLogic.Tests.Model.Station
|
||||
{
|
||||
[TestFixture]
|
||||
public class TestData
|
||||
{
|
||||
[Test]
|
||||
public void TestCtor()
|
||||
{
|
||||
var data = new ShareeBike.Model.Stations.StationNS.Operator.Data();
|
||||
Assert.That(
|
||||
data.Color,
|
||||
Is.Null);
|
||||
|
||||
Assert.That(
|
||||
data.Hours,
|
||||
Is.EqualTo(string.Empty));
|
||||
|
||||
Assert.That(
|
||||
data.Name,
|
||||
Is.EqualTo(string.Empty));
|
||||
|
||||
Assert.That(
|
||||
data.MailAddressText,
|
||||
Is.EqualTo(string.Empty));
|
||||
|
||||
Assert.That(
|
||||
data.PhoneNumberText,
|
||||
Is.EqualTo(string.Empty));
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void TestCtor_Null()
|
||||
{
|
||||
var data = new ShareeBike.Model.Stations.StationNS.Operator.Data(null, null, null, null, null);
|
||||
Assert.That(
|
||||
data.Color,
|
||||
Is.Null);
|
||||
|
||||
Assert.That(
|
||||
data.Hours,
|
||||
Is.EqualTo(string.Empty));
|
||||
|
||||
Assert.That(
|
||||
data.Name,
|
||||
Is.EqualTo(string.Empty));
|
||||
|
||||
Assert.That(
|
||||
data.MailAddressText,
|
||||
Is.EqualTo(string.Empty));
|
||||
|
||||
Assert.That(
|
||||
data.PhoneNumberText,
|
||||
Is.EqualTo(string.Empty));
|
||||
}
|
||||
}
|
||||
}
|
29
SharedBusinessLogic.Tests/Model/Station/TestNullStation.cs
Normal file
29
SharedBusinessLogic.Tests/Model/Station/TestNullStation.cs
Normal file
|
@ -0,0 +1,29 @@
|
|||
using System.Linq;
|
||||
using NUnit.Framework;
|
||||
using ShareeBike.Model.Stations;
|
||||
|
||||
namespace SharedBusinessLogic.Tests.Fixtures.ObjectTests.Station
|
||||
{
|
||||
[TestFixture]
|
||||
public class TestNullStation
|
||||
{
|
||||
[Test]
|
||||
public void TestConstruct()
|
||||
{
|
||||
var nullStation = new ShareeBike.Model.Stations.StationNS.NullStation();
|
||||
|
||||
// Was -1 before switching type of id from int to string when switching from COPRI version v4.0 to v4.1
|
||||
Assert.That(
|
||||
nullStation.Id,
|
||||
Is.Null);
|
||||
|
||||
Assert.That(nullStation.Group.ToList().Count, Is.EqualTo(0));
|
||||
Assert.That(nullStation.StationName, Is.EqualTo(string.Empty));
|
||||
Assert.That(nullStation.Position.Latitude, Is.NaN);
|
||||
Assert.That(nullStation.Position.Longitude, Is.NaN);
|
||||
Assert.That(
|
||||
nullStation.OperatorData,
|
||||
Is.Not.Null);
|
||||
}
|
||||
}
|
||||
}
|
49
SharedBusinessLogic.Tests/Model/Station/TestStation.cs
Normal file
49
SharedBusinessLogic.Tests/Model/Station/TestStation.cs
Normal file
|
@ -0,0 +1,49 @@
|
|||
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);
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue