mirror of
https://dev.azure.com/TeilRad/sharee.bike%20App/_git/Code
synced 2024-11-16 07:06:33 +01:00
43 lines
1.2 KiB
C#
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.");
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|