sharee.bike-App/TestShareeLib/Model/Bikes/BikeInfoNS/BC/TestBikeInfoMutable.cs

67 lines
2.1 KiB
C#
Raw Normal View History

2023-01-18 14:22:51 +01:00
using System;
2021-07-12 21:31:46 +02:00
using System.Collections.Generic;
2022-08-30 15:42:25 +02:00
using NSubstitute;
using NUnit.Framework;
using TINK.Model.Bikes.BikeInfoNS;
using TINK.Model.Bikes.BikeInfoNS.BikeNS;
2021-07-12 21:31:46 +02:00
using TINK.Model.State;
2022-08-30 15:42:25 +02:00
using IBikeInfo = TINK.Model.Bikes.BikeInfoNS.BC.IBikeInfo;
2021-07-12 21:31:46 +02:00
namespace TestTINKLib.Fixtures.ObjectTests.Bike
{
2022-09-06 16:08:19 +02:00
[TestFixture]
public class TestBikeInfoMutable
{
private class BikeInfoMutable : TINK.Model.Bikes.BikeInfoNS.BC.BikeInfoMutable
{
public BikeInfoMutable(
string id,
LockModel lockModel,
bool isDemo = false,
IEnumerable<string> group = null,
WheelType? wheelType = null,
TypeOfBike? typeOfBike = null,
2023-04-19 12:14:14 +02:00
AaRideType? aaRideType = null,
2022-09-06 16:08:19 +02:00
string description = null,
string stationId = null,
string stationName = null,
Uri operatorUri = null,
RentalDescription tariffDescription = null,
Func<DateTime> dateTimeProvider = null,
IStateInfo stateInfo = null) : base(
2023-04-19 12:14:14 +02:00
new TINK.Model.Bikes.BikeInfoNS.BikeNS.Bike(id, lockModel, wheelType, typeOfBike, aaRideType, description),
2022-09-06 16:08:19 +02:00
new TINK.Model.Bikes.BikeInfoNS.DriveNS.Drive(),
2023-01-18 14:22:51 +01:00
TINK.Model.Bikes.BikeInfoNS.BC.DataSource.Copri,
2022-09-06 16:08:19 +02:00
isDemo,
group,
stationId,
stationName,
operatorUri,
tariffDescription,
dateTimeProvider,
stateInfo)
{
}
}
[Test]
public void TestConstruct()
{
var l_oBikeInfo = new BikeInfoMutable("17", LockModel.ILockIt);
Assert.AreEqual("17", l_oBikeInfo.Id);
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);
2023-04-19 12:14:14 +02:00
l_oBikeInfo = new BikeInfoMutable("22", LockModel.ILockIt, false, new List<string> { "TINK" }, WheelType.Trike, TypeOfBike.Cargo, AaRideType.NoAaRide, "Test description", "23");
2022-09-06 16:08:19 +02:00
Assert.AreEqual("22", l_oBikeInfo.Id);
Assert.IsFalse(l_oBikeInfo.IsDemo);
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);
}
}
2021-07-12 21:31:46 +02:00
}