mirror of
https://dev.azure.com/TeilRad/sharee.bike%20App/_git/Code
synced 2024-12-23 15:46:29 +01:00
155 lines
5.6 KiB
C#
155 lines
5.6 KiB
C#
using NUnit.Framework;
|
|
using System;
|
|
using TINK.Model.Bike.BluetoothLock;
|
|
namespace TestTINKLib.Fixtures.ObjectTests.Bike.BluetoothLock
|
|
{
|
|
[TestFixture]
|
|
public class TestLockInfo
|
|
{
|
|
/// <summary>
|
|
/// Moved to TestShareeLib (.Net Core)
|
|
/// </summary>
|
|
[Test]
|
|
public void TestCtor()
|
|
{
|
|
Assert.AreEqual(
|
|
LockingState.Unknown,
|
|
new LockInfo.Builder { Id = 123 }.Build().State);
|
|
|
|
Assert.AreEqual(
|
|
123,
|
|
new LockInfo.Builder { Id = 123 }.Build().Id);
|
|
}
|
|
|
|
[Test]
|
|
public void TestEquals()
|
|
{
|
|
Assert.IsTrue(new LockInfo.Builder {
|
|
Id = 2,
|
|
Guid = new Guid("0000f00d-1212-efde-1523-785fef13d123"),
|
|
Seed = new byte[] { 1, 2 },
|
|
UserKey = new byte[] { 7, 2 },
|
|
AdminKey = new byte[] { 2, 1 },
|
|
State = LockingState.Closed}.Build() == new LockInfo.Builder {
|
|
Id = 2,
|
|
Guid = new Guid("0000f00d-1212-efde-1523-785fef13d123"),
|
|
Seed = new byte[] { 1, 2 },
|
|
UserKey = new byte[] { 7, 2 },
|
|
AdminKey = new byte[] { 2, 1 },
|
|
State = LockingState.Closed
|
|
}.Build());
|
|
}
|
|
|
|
[Test]
|
|
public void TestEqualsFalse()
|
|
{
|
|
Assert.IsFalse(new LockInfo.Builder
|
|
{
|
|
Id = 2,
|
|
Guid = new Guid("0000f00d-1212-efde-1523-785fef13d123"),
|
|
Seed = new byte[] { 1, 2 },
|
|
UserKey = new byte[] { 7, 2 },
|
|
AdminKey = new byte[] { 2, 1 },
|
|
State = LockingState.Closed
|
|
}.Build() == new LockInfo.Builder
|
|
{
|
|
Id = 3,
|
|
Guid = new Guid("0000f00d-1212-efde-1523-785fef13d123"),
|
|
Seed = new byte[] { 1, 2 },
|
|
UserKey = new byte[] { 7, 2 },
|
|
AdminKey = new byte[] { 2, 1 },
|
|
State = LockingState.Closed
|
|
}.Build());
|
|
|
|
Assert.IsFalse(new LockInfo.Builder
|
|
{
|
|
Id = 2,
|
|
Guid = new Guid("0000f00d-1212-efde-1523-785fef13d123"),
|
|
Seed = new byte[] { 1, 2 },
|
|
UserKey = new byte[] { 7, 2 },
|
|
AdminKey = new byte[] { 2, 1 },
|
|
State = LockingState.Closed
|
|
}.Build() == new LockInfo.Builder
|
|
{
|
|
Id = 2,
|
|
Guid = new Guid("1000f00d-1212-efde-1523-785fef13d123"),
|
|
Seed = new byte[] { 1, 2 },
|
|
UserKey = new byte[] { 7, 2 },
|
|
AdminKey = new byte[] { 2, 1 },
|
|
State = LockingState.Closed
|
|
}.Build());
|
|
|
|
Assert.IsFalse(new LockInfo.Builder
|
|
{
|
|
Id = 2,
|
|
Guid = new Guid("0000f00d-1212-efde-1523-785fef13d123"),
|
|
Seed = new byte[] { 1, 2 },
|
|
UserKey = new byte[] { 7, 2 },
|
|
AdminKey = new byte[] { 2, 1 },
|
|
State = LockingState.Closed
|
|
}.Build() == new LockInfo.Builder
|
|
{
|
|
Id = 2,
|
|
Guid = new Guid("0000f00d-1212-efde-1523-785fef13d123"),
|
|
Seed = new byte[] { 5, 2 },
|
|
UserKey = new byte[] { 7, 2 },
|
|
AdminKey = new byte[] { 2, 1 },
|
|
State = LockingState.Closed
|
|
}.Build());
|
|
|
|
Assert.IsFalse(new LockInfo.Builder
|
|
{
|
|
Id = 2,
|
|
Guid = new Guid("0000f00d-1212-efde-1523-785fef13d123"),
|
|
Seed = new byte[] { 1, 2 },
|
|
UserKey = new byte[] { 7, 2 },
|
|
AdminKey = new byte[] { 2, 1 },
|
|
State = LockingState.Closed
|
|
}.Build() == new LockInfo.Builder
|
|
{
|
|
Id = 2,
|
|
Guid = new Guid("0000f00d-1212-efde-1523-785fef13d123"),
|
|
Seed = new byte[] { 1, 2 },
|
|
UserKey = new byte[] { 9, 2 },
|
|
AdminKey = new byte[] { 2, 1 },
|
|
State = LockingState.Closed
|
|
}.Build());
|
|
|
|
Assert.IsFalse(new LockInfo.Builder
|
|
{
|
|
Id = 2,
|
|
Guid = new Guid("0000f00d-1212-efde-1523-785fef13d123"),
|
|
Seed = new byte[] { 1, 2 },
|
|
UserKey = new byte[] { 7, 2 },
|
|
AdminKey = new byte[] { 2, 1 },
|
|
State = LockingState.Closed
|
|
}.Build() == new LockInfo.Builder
|
|
{
|
|
Id = 2,
|
|
Guid = new Guid("0000f00d-1212-efde-1523-785fef13d123"),
|
|
Seed = new byte[] { 1, 2 },
|
|
UserKey = new byte[] { 7, 2 },
|
|
AdminKey = new byte[] { 11, 1 },
|
|
State = LockingState.Closed
|
|
}.Build());
|
|
|
|
Assert.IsFalse(new LockInfo.Builder
|
|
{
|
|
Id = 2,
|
|
Guid = new Guid("0000f00d-1212-efde-1523-785fef13d123"),
|
|
Seed = new byte[] { 1, 2 },
|
|
UserKey = new byte[] { 7, 2 },
|
|
AdminKey = new byte[] { 2, 1 },
|
|
State = LockingState.Closed
|
|
}.Build() == new LockInfo.Builder
|
|
{
|
|
Id = 2,
|
|
Guid = new Guid("0000f00d-1212-efde-1523-785fef13d123"),
|
|
Seed = new byte[] { 1, 2 },
|
|
UserKey = new byte[] { 7, 2 },
|
|
AdminKey = new byte[] { 2, 1 },
|
|
State = LockingState.Open
|
|
}.Build());
|
|
}
|
|
}
|
|
}
|