sharee.bike-App/LockIt.BusinessLogic.Tests/Services/BluetoothLock/Exception/TestCouldntCloseInconsistentStateExecption.cs

30 lines
726 B
C#
Raw Normal View History

2023-08-31 12:20:06 +02:00
using NUnit.Framework;
2024-04-09 12:53:23 +02:00
using ShareeBike.Model.Bikes.BikeInfoNS.BluetoothLock;
2021-05-13 17:07:16 +02:00
2024-04-09 12:53:23 +02:00
namespace ShareeBike.Services.BluetoothLock.Exception
2021-05-13 17:07:16 +02:00
{
2022-09-06 16:08:19 +02:00
[TestFixture]
public class TestCouldntCloseInconsistentStateExecption
{
[Test]
public void TestCtor_Unknown()
{
var ex = new CouldntCloseInconsistentStateExecption(LockingState.UnknownFromHardwareError);
2021-05-13 17:07:16 +02:00
2022-09-06 16:08:19 +02:00
Assert.That(
ex.Message,
2023-08-31 12:20:06 +02:00
Is.EqualTo("Lock reports unknown bold position. Lock could be closed or open. Please try again or contact customer support."));
2022-09-06 16:08:19 +02:00
}
2021-05-13 17:07:16 +02:00
2022-09-06 16:08:19 +02:00
[Test]
public void TestCtor_Open()
{
var ex = new CouldntCloseInconsistentStateExecption(LockingState.Open);
2021-05-13 17:07:16 +02:00
2022-09-06 16:08:19 +02:00
Assert.That(
ex.Message,
Does.Contain("locking state \"Open\""));
}
}
2021-05-13 17:07:16 +02:00
}