mirror of
https://dev.azure.com/TeilRad/sharee.bike%20App/_git/Code
synced 2024-11-05 18:46:30 +01:00
93 lines
2.3 KiB
C#
93 lines
2.3 KiB
C#
using System;
|
|
using NUnit.Framework;
|
|
using TINK.Model.Bikes.BikeInfoNS;
|
|
using TINK.Model.Bikes.BikeInfoNS.BC;
|
|
using TINK.Model.Bikes.BikeInfoNS.BikeNS;
|
|
using TINK.Model.Bikes.BikeInfoNS.DriveNS;
|
|
|
|
namespace TestShareeLib.Model.Bike.CopriLock
|
|
{
|
|
[TestFixture]
|
|
public class TestBikeInfo
|
|
{
|
|
[Test]
|
|
public void TestCtorAvailable()
|
|
{
|
|
var bike = new TINK.Model.Bikes.BikeInfoNS.CopriLock.BikeInfo(
|
|
new TINK.Model.Bikes.BikeInfoNS.BikeNS.Bike("bikeId", LockModel.Sigo),
|
|
new Drive(),
|
|
TINK.Model.Bikes.BikeInfoNS.BC.DataSource.Copri,
|
|
"stationId",
|
|
new TINK.Model.Bikes.BikeInfoNS.CopriLock.LockInfo());
|
|
|
|
Assert.That(
|
|
bike.State.Value,
|
|
Is.EqualTo(TINK.Model.State.InUseStateEnum.Disposable));
|
|
}
|
|
|
|
|
|
[Test]
|
|
public void TestCtorAvailableBikeNull()
|
|
{
|
|
Assert.That(
|
|
() => new TINK.Model.Bikes.BikeInfoNS.CopriLock.BikeInfo(
|
|
null,
|
|
new Drive(),
|
|
TINK.Model.Bikes.BikeInfoNS.BC.DataSource.Copri,
|
|
"stationId",
|
|
new TINK.Model.Bikes.BikeInfoNS.CopriLock.LockInfo()),
|
|
Throws.ArgumentNullException);
|
|
}
|
|
|
|
[Test]
|
|
public void TestCtorFeedbackRequired()
|
|
{
|
|
var bike = new TINK.Model.Bikes.BikeInfoNS.CopriLock.BikeInfo(
|
|
new TINK.Model.Bikes.BikeInfoNS.BikeNS.Bike("bikeId", LockModel.Sigo),
|
|
new Drive(),
|
|
TINK.Model.Bikes.BikeInfoNS.BC.DataSource.Copri,
|
|
"stationId",
|
|
new TINK.Model.Bikes.BikeInfoNS.CopriLock.LockInfo(),
|
|
true);
|
|
|
|
Assert.That(
|
|
bike.State.Value,
|
|
Is.EqualTo(TINK.Model.State.InUseStateEnum.FeedbackPending));
|
|
}
|
|
|
|
[Test]
|
|
public void TestCtorRequestedBikeNull()
|
|
{
|
|
Assert.That(
|
|
() => new TINK.Model.Bikes.BikeInfoNS.CopriLock.BikeInfo(
|
|
null,
|
|
new Drive(),
|
|
DataSource.Copri,
|
|
DateTime.Now,
|
|
"a@b",
|
|
"stationId",
|
|
new TINK.Model.Bikes.BikeInfoNS.CopriLock.LockInfo(),
|
|
new Uri("https://sharee.bike"),
|
|
new RentalDescription(),
|
|
() => DateTime.Now),
|
|
Throws.ArgumentNullException);
|
|
}
|
|
|
|
[Test]
|
|
public void TestCtorOccupiedBikeNull()
|
|
{
|
|
Assert.That(
|
|
() => new TINK.Model.Bikes.BikeInfoNS.CopriLock.BikeInfo(
|
|
null,
|
|
new Drive(),
|
|
DataSource.Copri,
|
|
DateTime.Now,
|
|
"a@b",
|
|
"stationId",
|
|
new TINK.Model.Bikes.BikeInfoNS.CopriLock.LockInfo(),
|
|
new Uri("https://sharee.bike"),
|
|
new RentalDescription()),
|
|
Throws.ArgumentNullException);
|
|
}
|
|
}
|
|
}
|