Version 3.0.270

This commit is contained in:
Oliver Hauff 2022-01-04 18:59:16 +01:00
parent 67999ef4ae
commit e0c75d5b37
81 changed files with 812 additions and 474 deletions

View file

@ -24,7 +24,9 @@ namespace TestTINKLib.Fixtures.ObjectTests.Bike.BluetoothLock
public void TestCreate()
{
// Verify handler for disposable bike.
var bike = new BikeInfoMutable(new BikeInfo("22", 5200544, new Guid("00000000-0000-0000-0000-000000000001"), "12"));
var bike = new BikeInfoMutable(
new BikeInfo("22", 5200544, new Guid("00000000-0000-0000-0000-000000000001"), "12"),
"My Station Name");
Assert.AreEqual(InUseStateEnum.Disposable, bike.State.Value);
Assert.AreEqual(LockingState.Disconnected, bike.LockInfo.State);
Assert.AreEqual(
@ -42,7 +44,9 @@ namespace TestTINKLib.Fixtures.ObjectTests.Bike.BluetoothLock
MockRepository.GenerateStub<IUser>()).GetType());
// Verify handler for requested bike with state unknown.
bike = new BikeInfoMutable(new BikeInfo("22", 0 /* lock Id */, new Guid(), /*K User*/ null, /*K Admin*/ null, /*K Seed*/ null, new DateTime(2020, 1, 1), "a@b.com", "12", null, null, () => new DateTime(2020, 1, 1), false, new List<string>(), TINK.Model.Bike.WheelType.Mono, TINK.Model.Bike.TypeOfBike.Allround));
bike = new BikeInfoMutable(
new BikeInfo("22", 0 /* lock Id */, new Guid(), /*K User*/ null, /*K Admin*/ null, /*K Seed*/ null, new DateTime(2020, 1, 1), "a@b.com", "12", null, null, () => new DateTime(2020, 1, 1), false, new List<string>(), TINK.Model.Bike.WheelType.Mono, TINK.Model.Bike.TypeOfBike.Allround),
"My Station Name");
Assert.AreEqual(
typeof(ReservedDisconnected),
RequestHandlerFactory.Create(
@ -58,7 +62,9 @@ namespace TestTINKLib.Fixtures.ObjectTests.Bike.BluetoothLock
MockRepository.GenerateStub<IUser>()).GetType());
// Verify handler for requested bike with state closed.
bike = new BikeInfoMutable(new BikeInfo("22", 0 /* lock Id*/, new Guid(), null, null, null, new System.DateTime(2020, 1, 1), "a@b.com", "12", null, null, () => new DateTime(2020, 1, 1), false, new List<string>(), TINK.Model.Bike.WheelType.Mono, TINK.Model.Bike.TypeOfBike.Allround));
bike = new BikeInfoMutable(
new BikeInfo("22", 0 /* lock Id*/, new Guid(), null, null, null, new DateTime(2020, 1, 1), "a@b.com", "12", null, null, () => new DateTime(2020, 1, 1), false, new List<string>(), TINK.Model.Bike.WheelType.Mono, TINK.Model.Bike.TypeOfBike.Allround),
"My Station Name");
bike.LockInfo.State = LockingState.Closed;
Assert.AreEqual(
typeof(ReservedClosed),
@ -75,7 +81,9 @@ namespace TestTINKLib.Fixtures.ObjectTests.Bike.BluetoothLock
MockRepository.GenerateStub<IUser>()).GetType());
// Verify handler for requested bike with state open.
bike = new BikeInfoMutable(new BikeInfo("22", 0 /* lock Id*/, new Guid(), null, null, null, new DateTime(2020, 1, 1), "a@b.com", "12", null, null, () => new DateTime(2020, 1, 1), false, new List<string>(), TINK.Model.Bike.WheelType.Mono, TINK.Model.Bike.TypeOfBike.Allround));
bike = new BikeInfoMutable(
new BikeInfo("22", 0 /* lock Id*/, new Guid(), null, null, null, new DateTime(2020, 1, 1), "a@b.com", "12", null, null, () => new DateTime(2020, 1, 1), false, new List<string>(), TINK.Model.Bike.WheelType.Mono, TINK.Model.Bike.TypeOfBike.Allround),
"My Station Name");
bike.LockInfo.State = LockingState.Open;
Assert.AreEqual(
typeof(ReservedOpen),
@ -92,7 +100,9 @@ namespace TestTINKLib.Fixtures.ObjectTests.Bike.BluetoothLock
MockRepository.GenerateStub<IUser>()).GetType());
// Verify handler for booked bike with state closed.
bike = new BikeInfoMutable(new BikeInfo("22", 0 /* lock Id*/, new Guid(), null, null, null, new System.DateTime(2020, 1, 1), "a@b.com", "12", null /*operator uri*/, null, false, new List<string>(), TINK.Model.Bike.WheelType.Mono, TINK.Model.Bike.TypeOfBike.Allround));
bike = new BikeInfoMutable(
new BikeInfo("22", 0 /* lock Id*/, new Guid(), null, null, null, new System.DateTime(2020, 1, 1), "a@b.com", "12", null /*operator uri*/, null, false, new List<string>(), TINK.Model.Bike.WheelType.Mono, TINK.Model.Bike.TypeOfBike.Allround),
"My Station Name");
bike.LockInfo.State = LockingState.Closed;
Assert.AreEqual(
typeof(BookedClosed),
@ -109,7 +119,9 @@ namespace TestTINKLib.Fixtures.ObjectTests.Bike.BluetoothLock
MockRepository.GenerateStub<IUser>()).GetType());
// Verify handler for booked bike with state open.
bike = new BikeInfoMutable(new BikeInfo("22", 0 /* lock Id*/, new Guid(), null, null, null, new System.DateTime(2020, 1, 1), "a@b.com", "12", null /*operator uri*/, null, false, new List<string>(), TINK.Model.Bike.WheelType.Mono, TINK.Model.Bike.TypeOfBike.Allround));
bike = new BikeInfoMutable(
new BikeInfo("22", 0 /* lock Id*/, new Guid(), null, null, null, new System.DateTime(2020, 1, 1), "a@b.com", "12", null /*operator uri*/, null, false, new List<string>(), TINK.Model.Bike.WheelType.Mono, TINK.Model.Bike.TypeOfBike.Allround),
"My Station Name");
bike.LockInfo.State = LockingState.Open;
Assert.AreEqual(
typeof(BookedOpen),
@ -126,7 +138,9 @@ namespace TestTINKLib.Fixtures.ObjectTests.Bike.BluetoothLock
MockRepository.GenerateStub<IUser>()).GetType());
// Verify handler for booked bike with state unknown.
bike = new BikeInfoMutable(new BikeInfo("22", 0 /* lock Id*/, new Guid(), null, null, null, new System.DateTime(2020, 1, 1), "a@b.com", "12", null /*operator uri*/, null, false, new List<string>(), TINK.Model.Bike.WheelType.Mono, TINK.Model.Bike.TypeOfBike.Allround));
bike = new BikeInfoMutable(
new BikeInfo("22", 0 /* lock Id*/, new Guid(), null, null, null, new System.DateTime(2020, 1, 1), "a@b.com", "12", null /*operator uri*/, null, false, new List<string>(), TINK.Model.Bike.WheelType.Mono, TINK.Model.Bike.TypeOfBike.Allround),
"My Station Name");
Assert.AreEqual(
typeof(BookedDisconnected),