mirror of
https://dev.azure.com/TeilRad/sharee.bike%20App/_git/Code
synced 2024-11-16 15:16:34 +01:00
49 lines
982 B
C#
49 lines
982 B
C#
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
|
|
{
|
|
[TestFixture]
|
|
public class TestDriveMutable
|
|
{
|
|
[Test]
|
|
public void TestCtorNoArgs()
|
|
{
|
|
var drive = new DriveMutable();
|
|
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 DriveMutable(engine, battery);
|
|
|
|
Assert.That(
|
|
drive.Engine.Manufacturer,
|
|
Is.EqualTo("Bosch"));
|
|
|
|
Assert.That(
|
|
drive.Battery.CurrentChargePercent,
|
|
Is.EqualTo(97));
|
|
}
|
|
}
|
|
}
|