mirror of
https://dev.azure.com/TeilRad/sharee.bike%20App/_git/Code
synced 2025-04-21 12:36:28 +02:00
Version 3.0.270
This commit is contained in:
parent
67999ef4ae
commit
e0c75d5b37
81 changed files with 812 additions and 474 deletions
|
@ -1,20 +0,0 @@
|
|||
using NUnit.Framework;
|
||||
using TINK.Model.Bike.BC;
|
||||
|
||||
namespace TestTINKLib.Fixtures.ObjectTests.Bike.BC
|
||||
{
|
||||
/// <summary>
|
||||
/// Moved to TestShareeLib (.Net Core)
|
||||
/// </summary>
|
||||
[TestFixture]
|
||||
public class TestBikeInfo
|
||||
{
|
||||
[Test]
|
||||
public void TestCtorCopyNull()
|
||||
{
|
||||
Assert.Throws<System.ArgumentException>(
|
||||
() => new BikeInfo(null),
|
||||
"Verify that no unspecific reference not set to... exception is thrown");
|
||||
}
|
||||
}
|
||||
}
|
|
@ -22,11 +22,12 @@ namespace TestTINKLib.Fixtures.ObjectTests.Bike
|
|||
WheelType? wheelType = null,
|
||||
TypeOfBike? typeOfBike = null,
|
||||
string description = null,
|
||||
string currentStationId = null,
|
||||
string stationId = null,
|
||||
string stationName = null,
|
||||
Uri operatorUri = null,
|
||||
TariffDescription tariffDescription = null,
|
||||
Func<DateTime> dateTimeProvider = null,
|
||||
IStateInfo stateInfo = null) : base(id, isDemo, group, wheelType, typeOfBike, description, currentStationId, operatorUri, tariffDescription, dateTimeProvider, stateInfo)
|
||||
IStateInfo stateInfo = null) : base(id, isDemo, group, wheelType, typeOfBike, description, stationId, stationName, operatorUri, tariffDescription, dateTimeProvider, stateInfo)
|
||||
{
|
||||
}
|
||||
}
|
||||
|
@ -36,7 +37,7 @@ namespace TestTINKLib.Fixtures.ObjectTests.Bike
|
|||
{
|
||||
var l_oBikeInfo = new BikeInfoMutable("17");
|
||||
Assert.AreEqual("17", l_oBikeInfo.Id);
|
||||
Assert.IsNull(l_oBikeInfo.CurrentStation);
|
||||
Assert.IsNull(l_oBikeInfo.StationId);
|
||||
Assert.AreEqual(InUseStateEnum.Disposable, l_oBikeInfo.State.Value);
|
||||
Assert.AreEqual(null, l_oBikeInfo.WheelType);
|
||||
Assert.AreEqual(null, l_oBikeInfo.TypeOfBike);
|
||||
|
@ -44,7 +45,7 @@ namespace TestTINKLib.Fixtures.ObjectTests.Bike
|
|||
l_oBikeInfo = new BikeInfoMutable("22", false, new List<string> { "TINK" }, WheelType.Trike, TypeOfBike.Cargo, "Test description", "23");
|
||||
Assert.AreEqual("22", l_oBikeInfo.Id);
|
||||
Assert.IsFalse(l_oBikeInfo.IsDemo);
|
||||
Assert.AreEqual("23", l_oBikeInfo.CurrentStation);
|
||||
Assert.AreEqual("23", l_oBikeInfo.StationId);
|
||||
Assert.AreEqual(InUseStateEnum.Disposable, l_oBikeInfo.State.Value);
|
||||
Assert.AreEqual(WheelType.Trike, l_oBikeInfo.WheelType);
|
||||
Assert.AreEqual(TypeOfBike.Cargo, l_oBikeInfo.TypeOfBike);
|
||||
|
@ -60,18 +61,19 @@ namespace TestTINKLib.Fixtures.ObjectTests.Bike
|
|||
l_oBikeInfoMock.Stub(x => x.Id).Return("22");
|
||||
l_oBikeInfoMock.Stub(x => x.TypeOfBike).Return(TypeOfBike.Cargo);
|
||||
l_oBikeInfoMock.Stub(x => x.WheelType).Return(WheelType.Trike);
|
||||
l_oBikeInfoMock.Stub(x => x.CurrentStation).Return("23");
|
||||
l_oBikeInfoMock.Stub(x => x.StationId).Return("23");
|
||||
l_oBikeInfoMock.Stub(x => x.State).Return(l_oStateInfoMock);
|
||||
l_oStateInfoMock.Stub(x => x.Value).Return(InUseStateEnum.Booked);
|
||||
l_oStateInfoMock.Stub(x => x.From).Return(new System.DateTime(2018, 01, 03));
|
||||
l_oStateInfoMock.Stub(x => x.MailAddress).Return("a@b");
|
||||
l_oStateInfoMock.Stub(x => x.Code).Return("234");
|
||||
|
||||
var l_oBikeInfo = new TINK.Model.Bike.BC.BikeInfoMutable(l_oBikeInfoMock);
|
||||
var l_oBikeInfo = new TINK.Model.Bike.BC.BikeInfoMutable(l_oBikeInfoMock, "My Station Name");
|
||||
|
||||
Assert.AreEqual(InUseStateEnum.Booked, l_oBikeInfo.State.Value);
|
||||
Assert.AreEqual("22", l_oBikeInfo.Id);
|
||||
Assert.AreEqual("23", l_oBikeInfo.CurrentStation);
|
||||
Assert.AreEqual("23", l_oBikeInfo.StationId);
|
||||
Assert.AreEqual("My Station Name", l_oBikeInfo.StationName);
|
||||
Assert.AreEqual(WheelType.Trike, l_oBikeInfo.WheelType);
|
||||
Assert.AreEqual(TypeOfBike.Cargo, l_oBikeInfo.TypeOfBike);
|
||||
Assert.AreEqual(InUseStateEnum.Booked, l_oBikeInfo.State.Value);
|
||||
|
@ -85,18 +87,18 @@ namespace TestTINKLib.Fixtures.ObjectTests.Bike
|
|||
l_oBikeInfoMock.Stub(x => x.Id).Return("22");
|
||||
l_oBikeInfoMock.Stub(x => x.TypeOfBike).Return(TypeOfBike.Cargo);
|
||||
l_oBikeInfoMock.Stub(x => x.WheelType).Return(WheelType.Trike);
|
||||
l_oBikeInfoMock.Stub(x => x.CurrentStation).Return("23");
|
||||
l_oBikeInfoMock.Stub(x => x.StationId).Return("23");
|
||||
l_oBikeInfoMock.Stub(x => x.State).Return(l_oStateInfoMock);
|
||||
l_oStateInfoMock.Stub(x => x.Value).Return(InUseStateEnum.Reserved);
|
||||
l_oStateInfoMock.Stub(x => x.From).Return(new System.DateTime(2018, 01, 03));
|
||||
l_oStateInfoMock.Stub(x => x.MailAddress).Return("a@b");
|
||||
l_oStateInfoMock.Stub(x => x.Code).Return("234");
|
||||
|
||||
l_oBikeInfo = new TINK.Model.Bike.BC.BikeInfoMutable(l_oBikeInfoMock);
|
||||
l_oBikeInfo = new TINK.Model.Bike.BC.BikeInfoMutable(l_oBikeInfoMock, "My Station Name");
|
||||
|
||||
Assert.AreEqual(InUseStateEnum.Reserved, l_oBikeInfo.State.Value);
|
||||
Assert.AreEqual("22", l_oBikeInfo.Id);
|
||||
Assert.AreEqual("23", l_oBikeInfo.CurrentStation);
|
||||
Assert.AreEqual("23", l_oBikeInfo.StationId);
|
||||
Assert.AreEqual(WheelType.Trike, l_oBikeInfo.WheelType);
|
||||
Assert.AreEqual(TypeOfBike.Cargo, l_oBikeInfo.TypeOfBike);
|
||||
Assert.AreEqual(InUseStateEnum.Reserved, l_oBikeInfo.State.Value);
|
||||
|
@ -110,15 +112,15 @@ namespace TestTINKLib.Fixtures.ObjectTests.Bike
|
|||
l_oBikeInfoMock.Stub(x => x.Id).Return("22");
|
||||
l_oBikeInfoMock.Stub(x => x.TypeOfBike).Return(TypeOfBike.Cargo);
|
||||
l_oBikeInfoMock.Stub(x => x.WheelType).Return(WheelType.Trike);
|
||||
l_oBikeInfoMock.Stub(x => x.CurrentStation).Return("23");
|
||||
l_oBikeInfoMock.Stub(x => x.StationId).Return("23");
|
||||
l_oBikeInfoMock.Stub(x => x.State).Return(l_oStateInfoMock);
|
||||
l_oStateInfoMock.Stub(x => x.Value).Return(InUseStateEnum.Disposable);
|
||||
|
||||
l_oBikeInfo = new TINK.Model.Bike.BC.BikeInfoMutable(l_oBikeInfoMock);
|
||||
l_oBikeInfo = new TINK.Model.Bike.BC.BikeInfoMutable(l_oBikeInfoMock, "My Station Name");
|
||||
|
||||
Assert.AreEqual(InUseStateEnum.Disposable, l_oBikeInfo.State.Value);
|
||||
Assert.AreEqual("22", l_oBikeInfo.Id);
|
||||
Assert.AreEqual("23", l_oBikeInfo.CurrentStation);
|
||||
Assert.AreEqual("23", l_oBikeInfo.StationId);
|
||||
Assert.AreEqual(WheelType.Trike, l_oBikeInfo.WheelType);
|
||||
Assert.AreEqual(TypeOfBike.Cargo, l_oBikeInfo.TypeOfBike);
|
||||
Assert.AreEqual(InUseStateEnum.Disposable, l_oBikeInfo.State.Value);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue