2023-08-31 12:31:38 +02:00
|
|
|
using NSubstitute;
|
2022-08-30 15:42:25 +02:00
|
|
|
using NUnit.Framework;
|
|
|
|
using TINK.Model.Bikes.BikeInfoNS.DriveNS;
|
|
|
|
using TINK.Model.Bikes.BikeInfoNS.DriveNS.BatteryNS;
|
|
|
|
using TINK.Model.Bikes.BikeInfoNS.DriveNS.EngineNS;
|
|
|
|
|
|
|
|
namespace TestShareeLib.Model.BikeInfo.DriveNS
|
|
|
|
{
|
2022-09-06 16:08:19 +02:00
|
|
|
[TestFixture]
|
|
|
|
public class TestDriveMutable
|
|
|
|
{
|
|
|
|
[Test]
|
|
|
|
public void TestCtorNoArgs()
|
|
|
|
{
|
2023-08-31 12:31:38 +02:00
|
|
|
var drive = new DriveMutable();
|
2022-09-06 16:08:19 +02:00
|
|
|
Assert.That(
|
|
|
|
drive.Type,
|
|
|
|
Is.EqualTo(DriveType.SoleHumanPowered));
|
|
|
|
|
|
|
|
Assert.That(
|
|
|
|
drive.Engine,
|
|
|
|
Is.Not.Null);
|
|
|
|
|
|
|
|
Assert.That(
|
|
|
|
drive.Battery,
|
|
|
|
Is.Not.Null);
|
|
|
|
}
|
|
|
|
|
|
|
|
[Test]
|
|
|
|
public void TestCtor()
|
|
|
|
{
|
|
|
|
var engine = Substitute.For<IEngine>();
|
|
|
|
var battery = Substitute.For<IBattery>();
|
|
|
|
|
|
|
|
engine.Manufacturer.Returns("Bosch");
|
|
|
|
battery.CurrentChargePercent.Returns(97);
|
|
|
|
|
2023-08-31 12:31:38 +02:00
|
|
|
var drive = new DriveMutable(engine, battery);
|
2022-09-06 16:08:19 +02:00
|
|
|
|
|
|
|
Assert.That(
|
|
|
|
drive.Engine.Manufacturer,
|
|
|
|
Is.EqualTo("Bosch"));
|
|
|
|
|
|
|
|
Assert.That(
|
|
|
|
drive.Battery.CurrentChargePercent,
|
|
|
|
Is.EqualTo(97));
|
|
|
|
}
|
|
|
|
}
|
2022-08-30 15:42:25 +02:00
|
|
|
}
|