mirror of
https://dev.azure.com/TeilRad/sharee.bike%20App/_git/Code
synced 2025-04-19 03:27:29 +02:00
Version 3.0.337
This commit is contained in:
parent
fd0e63cf10
commit
573fe77e12
2336 changed files with 33688 additions and 86082 deletions
|
@ -0,0 +1,49 @@
|
|||
using NUnit.Framework;
|
||||
using TINK.Model.Bikes.BikeInfoNS.DriveNS.BatteryNS;
|
||||
|
||||
namespace TestShareeLib.Model.BikeInfo.DriveNS.BatteryNS
|
||||
{
|
||||
[TestFixture]
|
||||
public class TestBattery
|
||||
{
|
||||
[Test]
|
||||
public void TestSetCurrentChargePercent() => Assert.That(
|
||||
new Battery.Builder { CurrentChargePercent = 20 }.Build().CurrentChargePercent,
|
||||
Is.EqualTo(20.0));
|
||||
|
||||
[Test]
|
||||
public void TestSetCurrentChargePercentOutOfRange() => Assert.That(
|
||||
new Battery.Builder { CurrentChargePercent = 101 }.Build().CurrentChargePercent,
|
||||
Is.NaN);
|
||||
|
||||
[Test]
|
||||
public void TestSetCurrentChargeBars() => Assert.That(
|
||||
new Battery.Builder { CurrentChargeBars = 21, MaxChargeBars = 22 }.Build().CurrentChargeBars,
|
||||
Is.EqualTo(21));
|
||||
|
||||
[Test]
|
||||
public void TestSetCurrentChargeBarsOutOfRange() => Assert.That(
|
||||
new Battery.Builder { CurrentChargeBars = -1, MaxChargeBars = 22 }.Build().CurrentChargeBars,
|
||||
Is.Null);
|
||||
|
||||
[Test]
|
||||
public void TestSetMaxChargeBars() => Assert.That(
|
||||
new Battery.Builder { MaxChargeBars = 23 }.Build().MaxChargeBars,
|
||||
Is.EqualTo(23));
|
||||
|
||||
[Test]
|
||||
public void TestSetMaxChargeBarsOutOfRange() => Assert.That(
|
||||
new Battery.Builder { MaxChargeBars = -1 }.Build().MaxChargeBars,
|
||||
Is.Null);
|
||||
|
||||
[Test]
|
||||
public void TestSetCurrentChargeBarsNoMaxValueSet() => Assert.That(
|
||||
new Battery.Builder { CurrentChargeBars = 21 }.Build().CurrentChargeBars,
|
||||
Is.Null);
|
||||
|
||||
[Test]
|
||||
public void TestSetCurrentChargeBars_CurrentValueTooLarge() => Assert.That(
|
||||
new Battery.Builder { CurrentChargeBars = 25, MaxChargeBars = 22 }.Build().CurrentChargeBars,
|
||||
Is.Null);
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue