sharee.bike-App/TestShareeSharedGuiLib/ViewModel/TestBarLevelViewModel.cs
Anja Müller-Meißner 0468955d49 Version 3.0.338
2022-09-08 09:55:14 +02:00

75 lines
2.2 KiB
C#

using ShareeSharedGuiLib.ViewModel;
namespace TestShareeSharedGuiLib.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);
}
}