sharee.bike-App/SharedBusinessLogic.Tests/Model/Bikes/BikeInfoNS/DriveNS/TestDriveMutable.cs
2024-04-09 12:53:23 +02:00

50 lines
1.1 KiB
C#

using NSubstitute;
using NUnit.Framework;
using ShareeBike.Model.Bikes.BikeInfoNS.DriveNS;
using ShareeBike.Model.Bikes.BikeInfoNS.DriveNS.BatteryNS;
using ShareeBike.Model.Bikes.BikeInfoNS.DriveNS.EngineNS;
using DriveType = ShareeBike.Model.Bikes.BikeInfoNS.DriveNS.DriveType;
namespace SharedBusinessLogic.Tests.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));
}
}
}