2024-04-09 12:53:23 +02:00
|
|
|
using SharedGui.ViewModel;
|
2022-08-30 15:42:25 +02:00
|
|
|
|
2024-04-09 12:53:23 +02:00
|
|
|
namespace SharedGui.Tests.ViewModel
|
2022-08-30 15:42:25 +02:00
|
|
|
{
|
2022-09-06 16:08:19 +02:00
|
|
|
[TestFixture]
|
|
|
|
public class TestBarLevelViewModel
|
|
|
|
{
|
|
|
|
[Test]
|
|
|
|
public void TestIsBatteryChargeLevelImageVisibleNull()
|
|
|
|
=> Assert.That(
|
|
|
|
new BarLevelViewModel().IsBatteryChargeLevelImageVisible,
|
|
|
|
Is.False);
|
2022-08-30 15:42:25 +02:00
|
|
|
|
2022-09-06 16:08:19 +02:00
|
|
|
[Test]
|
|
|
|
public void TestIsBatteryChargeLevelImageVisibleNot5()
|
|
|
|
=> Assert.That(
|
|
|
|
new BarLevelViewModel { Maximum = 6 }.IsBatteryChargeLevelImageVisible,
|
|
|
|
Is.False);
|
2022-08-30 15:42:25 +02:00
|
|
|
|
2022-09-06 16:08:19 +02:00
|
|
|
[Test]
|
|
|
|
public void TestIsBatteryChargeLevelImageVisible5()
|
|
|
|
=> Assert.That(
|
|
|
|
new BarLevelViewModel { Maximum = 5 }.IsBatteryChargeLevelImageVisible,
|
|
|
|
Is.True);
|
2022-08-30 15:42:25 +02:00
|
|
|
|
2022-09-06 16:08:19 +02:00
|
|
|
[Test]
|
|
|
|
public void TestBatteryChargeLevelImageSourceStringNull()
|
|
|
|
=> Assert.That(
|
|
|
|
new BarLevelViewModel().BatteryChargeLevelImageSourceString,
|
|
|
|
Is.EqualTo("battery_undefined.png"));
|
2022-08-30 15:42:25 +02:00
|
|
|
|
2022-09-06 16:08:19 +02:00
|
|
|
[Test]
|
|
|
|
public void TestBatteryChargeLevelImageSourceStringNot5CurrentNull()
|
|
|
|
=> Assert.That(
|
|
|
|
new BarLevelViewModel { Maximum = 6 }.BatteryChargeLevelImageSourceString,
|
|
|
|
Is.EqualTo("battery_undefined.png"));
|
2022-08-30 15:42:25 +02:00
|
|
|
|
2022-09-06 16:08:19 +02:00
|
|
|
[Test]
|
|
|
|
public void TestBatteryChargeLevelImageSourceStringNot5()
|
|
|
|
=> Assert.That(
|
|
|
|
new BarLevelViewModel { Maximum = 6, Current = 3 }.BatteryChargeLevelImageSourceString,
|
|
|
|
Is.EqualTo("battery_undefined.png"));
|
2022-08-30 15:42:25 +02:00
|
|
|
|
2022-09-06 16:08:19 +02:00
|
|
|
[Test]
|
|
|
|
public void TestBatteryChargeLevelImageSourceStringMax5CurrentNull()
|
|
|
|
=> Assert.That(
|
|
|
|
new BarLevelViewModel { Maximum = 5 }.BatteryChargeLevelImageSourceString,
|
|
|
|
Is.EqualTo("battery_undefined.png"));
|
2022-08-30 15:42:25 +02:00
|
|
|
|
2022-09-06 16:08:19 +02:00
|
|
|
[Test]
|
|
|
|
public void TestBatteryChargeLevelImageSourceStringMax5Current3()
|
|
|
|
=> Assert.That(
|
|
|
|
new BarLevelViewModel { Maximum = 5, Current = 3 }.BatteryChargeLevelImageSourceString,
|
|
|
|
Is.EqualTo("battery_3_5.png"));
|
2022-08-30 15:42:25 +02:00
|
|
|
|
2022-09-06 16:08:19 +02:00
|
|
|
[Test]
|
|
|
|
public void TestIsBatteryChargeLevelLabelVisibleNull()
|
|
|
|
=> Assert.That(
|
|
|
|
new BarLevelViewModel().IsBatteryChargeLevelLabelVisible,
|
|
|
|
Is.False);
|
2022-08-30 15:42:25 +02:00
|
|
|
|
2022-09-06 16:08:19 +02:00
|
|
|
[Test]
|
|
|
|
public void TestIsBatteryChargeLevelLabelVisibleNot5()
|
|
|
|
=> Assert.That(
|
|
|
|
new BarLevelViewModel { Maximum = 5 }.IsBatteryChargeLevelLabelVisible,
|
|
|
|
Is.False);
|
2022-08-30 15:42:25 +02:00
|
|
|
|
2022-09-06 16:08:19 +02:00
|
|
|
[Test]
|
|
|
|
public void TestIsBatteryChargeLevelLabelVisible5()
|
|
|
|
=> Assert.That(
|
|
|
|
new BarLevelViewModel { Maximum = 6 }.IsBatteryChargeLevelLabelVisible,
|
|
|
|
Is.True);
|
2022-08-30 15:42:25 +02:00
|
|
|
|
2022-09-06 16:08:19 +02:00
|
|
|
}
|
2022-08-30 15:42:25 +02:00
|
|
|
}
|