using System; using NUnit.Framework; using ShareeBike.Services.BluetoothLock.BLE; namespace LockIt.BLE.Tests.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(ShareeBike.Services.BluetoothLock.DeviceState.Connecting)); break; case Plugin.BLE.Abstractions.DeviceState.Connected: Assert.That(state.GetDeviceState(), Is.EqualTo(ShareeBike.Services.BluetoothLock.DeviceState.Connected)); break; case Plugin.BLE.Abstractions.DeviceState.Disconnected: Assert.That(state.GetDeviceState(), Is.EqualTo(ShareeBike.Services.BluetoothLock.DeviceState.Disconnected)); break; case Plugin.BLE.Abstractions.DeviceState.Limited: Assert.That(state.GetDeviceState(), Is.EqualTo(ShareeBike.Services.BluetoothLock.DeviceState.Limited)); break; default: throw new Exception($"Unexpected state {state} detected."); } } } } }