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

59 lines
1.4 KiB
C#
Raw Normal View History

2023-01-18 14:22:51 +01:00
using System;
2022-08-30 15:42:25 +02:00
using System.Collections.Generic;
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;
using TINK.Model.State;
2021-05-13 20:09:46 +02:00
namespace TestTINKLib.Fixtures.ObjectTests.Bike.BC
{
2022-09-06 16:08:19 +02:00
[TestFixture]
public class TestBikeInfo
{
/// <summary>
/// Dummy subclass to provide assess to protected member for testing.
/// </summary>
private class TestBikeInfoSubClass : BikeInfo
{
public TestBikeInfoSubClass(
IStateInfo stateInfo,
TINK.Model.Bikes.BikeInfoNS.BikeNS.Bike bike,
2023-08-31 12:31:38 +02:00
DriveMutable drive,
2022-09-06 16:08:19 +02:00
bool? isDemo = DEFAULTVALUEISDEMO,
IEnumerable<string> group = null,
string stationId = null,
Uri operatorUri = null,
RentalDescription tariffDescription = null) : base(
stateInfo,
bike,
drive,
2023-01-18 14:22:51 +01:00
DataSource.Copri,
2022-09-06 16:08:19 +02:00
isDemo,
group,
stationId,
operatorUri,
tariffDescription)
{
}
}
2022-08-30 15:42:25 +02:00
2022-09-06 16:08:19 +02:00
[Test]
public void TestCtorBikeNull()
{
Assert.That(
2023-08-31 12:31:38 +02:00
() => new TestBikeInfoSubClass(new StateInfo(), null, new DriveMutable()),
2022-09-06 16:08:19 +02:00
Throws.ArgumentNullException);
}
2022-08-30 15:42:25 +02:00
2022-09-06 16:08:19 +02:00
[Test]
public void TestCtorDriveNull()
{
Assert.That(
() => new TestBikeInfoSubClass(new StateInfo(), new TINK.Model.Bikes.BikeInfoNS.BikeNS.Bike(string.Empty, LockModel.ILockIt), null),
Throws.ArgumentNullException);
}
}
2021-05-13 20:09:46 +02:00
}