sharee.bike-App/SharedGui.Tests/ViewModel/TestBarLevelViewModel.cs
2024-04-09 12:53:23 +02:00

75 lines
2.2 KiB
C#

using SharedGui.ViewModel;
namespace SharedGui.Tests.ViewModel
{
[TestFixture]
public class TestBarLevelViewModel
{
[Test]
public void TestIsBatteryChargeLevelImageVisibleNull()
=> Assert.That(
new BarLevelViewModel().IsBatteryChargeLevelImageVisible,
Is.False);
[Test]
public void TestIsBatteryChargeLevelImageVisibleNot5()
=> Assert.That(
new BarLevelViewModel { Maximum = 6 }.IsBatteryChargeLevelImageVisible,
Is.False);
[Test]
public void TestIsBatteryChargeLevelImageVisible5()
=> Assert.That(
new BarLevelViewModel { Maximum = 5 }.IsBatteryChargeLevelImageVisible,
Is.True);
[Test]
public void TestBatteryChargeLevelImageSourceStringNull()
=> Assert.That(
new BarLevelViewModel().BatteryChargeLevelImageSourceString,
Is.EqualTo("battery_undefined.png"));
[Test]
public void TestBatteryChargeLevelImageSourceStringNot5CurrentNull()
=> Assert.That(
new BarLevelViewModel { Maximum = 6 }.BatteryChargeLevelImageSourceString,
Is.EqualTo("battery_undefined.png"));
[Test]
public void TestBatteryChargeLevelImageSourceStringNot5()
=> Assert.That(
new BarLevelViewModel { Maximum = 6, Current = 3 }.BatteryChargeLevelImageSourceString,
Is.EqualTo("battery_undefined.png"));
[Test]
public void TestBatteryChargeLevelImageSourceStringMax5CurrentNull()
=> Assert.That(
new BarLevelViewModel { Maximum = 5 }.BatteryChargeLevelImageSourceString,
Is.EqualTo("battery_undefined.png"));
[Test]
public void TestBatteryChargeLevelImageSourceStringMax5Current3()
=> Assert.That(
new BarLevelViewModel { Maximum = 5, Current = 3 }.BatteryChargeLevelImageSourceString,
Is.EqualTo("battery_3_5.png"));
[Test]
public void TestIsBatteryChargeLevelLabelVisibleNull()
=> Assert.That(
new BarLevelViewModel().IsBatteryChargeLevelLabelVisible,
Is.False);
[Test]
public void TestIsBatteryChargeLevelLabelVisibleNot5()
=> Assert.That(
new BarLevelViewModel { Maximum = 5 }.IsBatteryChargeLevelLabelVisible,
Is.False);
[Test]
public void TestIsBatteryChargeLevelLabelVisible5()
=> Assert.That(
new BarLevelViewModel { Maximum = 6 }.IsBatteryChargeLevelLabelVisible,
Is.True);
}
}