sharee.bike-App/TestLockItBLE/Services/BluetoothLock/BLE/TestPluginBleHelper.cs
Anja Müller-Meißner 0468955d49 Version 3.0.338
2022-09-08 09:55:14 +02:00

43 lines
1.2 KiB
C#

using System;
using NUnit.Framework;
using TINK.Services.BluetoothLock.BLE;
namespace TestLockItBLE.Services.BluetoothLock.BLE
{
[TestFixture]
public class TestPluginBleHelper
{
[Test]
public void TestGetDeviceState()
{
foreach (Plugin.BLE.Abstractions.DeviceState state in Enum.GetValues(typeof(Plugin.BLE.Abstractions.DeviceState)))
{
switch (state)
{
case Plugin.BLE.Abstractions.DeviceState.Connecting:
Assert.That(state.GetDeviceState(),
Is.EqualTo(TINK.Services.BluetoothLock.DeviceState.Connecting));
break;
case Plugin.BLE.Abstractions.DeviceState.Connected:
Assert.That(state.GetDeviceState(),
Is.EqualTo(TINK.Services.BluetoothLock.DeviceState.Connected));
break;
case Plugin.BLE.Abstractions.DeviceState.Disconnected:
Assert.That(state.GetDeviceState(),
Is.EqualTo(TINK.Services.BluetoothLock.DeviceState.Disconnected));
break;
case Plugin.BLE.Abstractions.DeviceState.Limited:
Assert.That(state.GetDeviceState(),
Is.EqualTo(TINK.Services.BluetoothLock.DeviceState.Limited));
break;
default:
throw new Exception($"Unexpected state {state} detected.");
}
}
}
}
}