mirror of
https://dev.azure.com/TeilRad/sharee.bike%20App/_git/Code
synced 2025-07-17 16:47:26 +02:00
Initial version
This commit is contained in:
parent
41b618cb27
commit
e4fb48f6ab
24 changed files with 4387 additions and 0 deletions
|
@ -0,0 +1,66 @@
|
|||
using NUnit.Framework;
|
||||
using System;
|
||||
using System.Linq;
|
||||
using TINK.Model.Bike.BluetoothLock;
|
||||
|
||||
namespace TestTINKLib.Fixtures.ObjectTests.Bike.BluetoothLock
|
||||
{
|
||||
[TestFixture]
|
||||
public class TestLockInfoMutable
|
||||
{
|
||||
[Test]
|
||||
public void TestCtor()
|
||||
{
|
||||
var lockInfo = new LockInfoMutable(
|
||||
1,
|
||||
new Guid("00000000-0000-0000-0000-e57e6b9aee16"),
|
||||
new byte[] { 1, 2, 3 }, // User key
|
||||
new byte[] { 1, 23 }, // Admin key
|
||||
new byte[] { 1, 12 }, // Seed
|
||||
LockingState.Closed);
|
||||
|
||||
Assert.AreEqual(1, lockInfo.Id);
|
||||
Assert.AreEqual(new Guid("00000000-0000-0000-0000-e57e6b9aee16"), lockInfo.Guid);
|
||||
Assert.IsTrue((new byte[] { 1, 2, 3 }).SequenceEqual(lockInfo.UserKey));
|
||||
Assert.IsTrue((new byte[] { 1, 23 }).SequenceEqual(lockInfo.AdminKey));
|
||||
Assert.IsTrue((new byte[] { 1, 12 }).SequenceEqual(lockInfo.Seed));
|
||||
Assert.AreEqual(LockingState.Closed, lockInfo.State);
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void TestSetGuid()
|
||||
{
|
||||
var lockInfo = new LockInfoMutable(1, new Guid(), new byte[] { 1, 2, 3 }, new byte[] { 1, 23 }, new byte[] { 1, 12 }, LockingState.Closed);
|
||||
|
||||
lockInfo.Guid = new Guid("00000000-0000-0000-0000-e57e6b9aee16");
|
||||
Assert.AreEqual(new Guid("00000000-0000-0000-0000-e57e6b9aee16"), lockInfo.Guid);
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void TestLoad()
|
||||
{
|
||||
|
||||
var lockInfo = new LockInfoMutable(
|
||||
2,
|
||||
new Guid(),
|
||||
new byte[] { 5, 4 }, // User key
|
||||
new byte[] { 14, 223 }, // Admin key
|
||||
new byte[] { 3, 4, 5 }, // Seed
|
||||
LockingState.Closed);
|
||||
|
||||
lockInfo.Load(
|
||||
1,
|
||||
new Guid("00000000-0000-0000-0000-e57e6b9aee16"),
|
||||
new byte[] { 1, 12 }, // Seed
|
||||
new byte[] { 1, 2, 3 }, // User key)
|
||||
new byte[] { 1, 23 });
|
||||
|
||||
Assert.AreEqual(1, lockInfo.Id);
|
||||
Assert.AreEqual(new Guid("00000000-0000-0000-0000-e57e6b9aee16"), lockInfo.Guid);
|
||||
Assert.IsTrue((new byte[] { 1, 2, 3 }).SequenceEqual(lockInfo.UserKey));
|
||||
Assert.IsTrue((new byte[] { 1, 23 }).SequenceEqual(lockInfo.AdminKey));
|
||||
Assert.IsTrue((new byte[] { 1, 12 }).SequenceEqual(lockInfo.Seed));
|
||||
Assert.AreEqual(LockingState.Closed, lockInfo.State);
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue