sharee.bike-App/TestShareeLib/Model/BikeInfo/DriveNS/TestDriveMutable.cs

50 lines
1 KiB
C#
Raw Normal View History

2022-08-30 15:42:25 +02:00
using NSubstitute;
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()
{
var drive = new TINK.Model.Bikes.BikeInfoNS.DriveNS.Drive();
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);
var drive = new TINK.Model.Bikes.BikeInfoNS.DriveNS.Drive(engine, battery);
Assert.That(
drive.Engine.Manufacturer,
Is.EqualTo("Bosch"));
Assert.That(
drive.Battery.CurrentChargePercent,
Is.EqualTo(97));
}
}
2022-08-30 15:42:25 +02:00
}