Restructure aadp
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
using Aperio_Control_Centre.Aadp;
|
||||
using Aperio_Control_Centre.Aadp.Enumerations;
|
||||
using Aperio_Control_Centre.ACSDatabase;
|
||||
using Aperio_Control_Centre.ACSDatabase.Models;
|
||||
using Aperio_Control_Centre.ACSDatabase.Types;
|
||||
@@ -28,11 +28,11 @@ namespace Aperio_Control_Centre.UnitTest.AperioServer
|
||||
Assert.AreEqual("64.226.1.0", baseDevice.IPAddress);
|
||||
Assert.AreEqual(ConnectionStates.Offline, baseDevice.ConnectionState);
|
||||
Assert.AreEqual(1, baseDevice.DataBaseDeviceID);
|
||||
Assert.AreEqual(Enumerations.Status.UNKNOWN, baseDevice.DeviceStatus);
|
||||
Assert.AreEqual(Enumerations.TamperState.UNKNOWN, baseDevice.TamperState);
|
||||
Assert.AreEqual(Status.UNKNOWN, baseDevice.DeviceStatus);
|
||||
Assert.AreEqual(TamperState.UNKNOWN, baseDevice.TamperState);
|
||||
Assert.AreEqual(string.Empty, baseDevice.FirmwareVersion);
|
||||
Assert.IsNull(baseDevice.HwVersion);
|
||||
Assert.AreEqual(Enumerations.LockVersions.UNKNOWN, baseDevice.LockVersion);
|
||||
Assert.AreEqual(LockVersions.UNKNOWN, baseDevice.LockVersion);
|
||||
|
||||
Assert.IsEmpty(_screenLogging.Messages);
|
||||
//Assert.AreEqual("System - Device AA11BB - Ip address changed to 64.226.1.0", _screenLogging.Messages[0]);
|
||||
@@ -152,14 +152,14 @@ namespace Aperio_Control_Centre.UnitTest.AperioServer
|
||||
|
||||
AperioBase device = CreateAperioBase();
|
||||
|
||||
Assert.AreEqual(Enumerations.Status.UNKNOWN, device.DeviceStatus);
|
||||
Assert.AreEqual(Status.UNKNOWN, device.DeviceStatus);
|
||||
|
||||
Task.Run(async () =>
|
||||
{
|
||||
await device.SetDeviceStatus(Enumerations.Status.FAIL_UNKNOWN_ID, _token);
|
||||
await device.SetDeviceStatus(Status.FAIL_UNKNOWN_ID, _token);
|
||||
}).GetAwaiter().GetResult();
|
||||
|
||||
Assert.AreEqual(Enumerations.Status.FAIL_UNKNOWN_ID, device.DeviceStatus);
|
||||
Assert.AreEqual(Status.FAIL_UNKNOWN_ID, device.DeviceStatus);
|
||||
|
||||
Assert.IsEmpty(_statusBroadcast.Messages);
|
||||
|
||||
@@ -184,14 +184,14 @@ namespace Aperio_Control_Centre.UnitTest.AperioServer
|
||||
|
||||
AperioBase device = CreateAperioBase();
|
||||
|
||||
Assert.AreEqual(Enumerations.TamperState.UNKNOWN, device.TamperState);
|
||||
Assert.AreEqual(TamperState.UNKNOWN, device.TamperState);
|
||||
|
||||
Task.Run(async () =>
|
||||
{
|
||||
await device.SetTamperState(Enumerations.TamperState.TAMPER, _token);
|
||||
await device.SetTamperState(TamperState.TAMPER, _token);
|
||||
}).GetAwaiter().GetResult();
|
||||
|
||||
Assert.AreEqual(Enumerations.TamperState.TAMPER, device.TamperState);
|
||||
Assert.AreEqual(TamperState.TAMPER, device.TamperState);
|
||||
|
||||
Assert.HasCount(1, _statusBroadcast.Messages);
|
||||
Assert.AreEqual("SendTamperStatus AA11BB TAMPER", _statusBroadcast.Messages[0]);
|
||||
|
||||
@@ -1,15 +1,8 @@
|
||||
using Aperio_Control_Centre.Aadp;
|
||||
using Aperio_Control_Centre.Aadp.ApplicationTypes;
|
||||
using Aperio_Control_Centre.Aadp.Enumerations;
|
||||
using Aperio_Control_Centre.ACSDatabase;
|
||||
using Aperio_Control_Centre.ACSDatabase.Models;
|
||||
using Aperio_Control_Centre.ACSDatabase.Types;
|
||||
using Aperio_Control_Centre.AperioServer;
|
||||
using Aperio_Control_Centre.AperioServer.Devices;
|
||||
using Microsoft.AspNetCore.Connections;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Moq;
|
||||
using System.Net;
|
||||
using static Aperio_Control_Centre.Aadp.Enumerations;
|
||||
|
||||
namespace Aperio_Control_Centre.UnitTest.AperioServer
|
||||
{
|
||||
@@ -26,8 +19,8 @@ namespace Aperio_Control_Centre.UnitTest.AperioServer
|
||||
AperioDoor door = new(new("AA11BB"), _aperioConnectionContext, _screenLogging, _statusBroadcast, _dbContextFactory);
|
||||
|
||||
//Assert.AreEqual(Enumerations.DoorMode.UNKNOWN, door.GetDoorMode());
|
||||
Assert.AreEqual(Enumerations.DoorState.UNKNOWN, door.DoorState);
|
||||
Assert.AreEqual(Enumerations.LockState.UNKNOWN, door.LockState);
|
||||
Assert.AreEqual(DoorState.UNKNOWN, door.DoorState);
|
||||
Assert.AreEqual(LockState.UNKNOWN, door.LockState);
|
||||
//Assert.AreEqual(Enumerations.KeyCylinderState.UNKNOWN, door.KeyCylinderState);
|
||||
//Assert.AreEqual(Enumerations.HandleState.UNKNOWN, door.HandleState);
|
||||
|
||||
@@ -104,14 +97,14 @@ namespace Aperio_Control_Centre.UnitTest.AperioServer
|
||||
|
||||
AperioDoor device = CreateAperioDoor();
|
||||
|
||||
Assert.AreEqual(Enumerations.DoorState.UNKNOWN, device.DoorState);
|
||||
Assert.AreEqual(DoorState.UNKNOWN, device.DoorState);
|
||||
|
||||
Task.Run(async () =>
|
||||
{
|
||||
await device.SetDoorState(Enumerations.DoorState.CLOSED, _token);
|
||||
await device.SetDoorState(DoorState.CLOSED, _token);
|
||||
}).GetAwaiter().GetResult();
|
||||
|
||||
Assert.AreEqual(Enumerations.DoorState.CLOSED, device.DoorState);
|
||||
Assert.AreEqual(DoorState.CLOSED, device.DoorState);
|
||||
|
||||
Assert.IsEmpty(_statusBroadcast.Messages);
|
||||
Assert.IsEmpty(_screenLogging.Messages);
|
||||
@@ -125,7 +118,7 @@ namespace Aperio_Control_Centre.UnitTest.AperioServer
|
||||
Assert.IsNotNull(logs);
|
||||
Assert.AreEqual("Doorstate (CLOSED)", logs[0].Message);
|
||||
|
||||
Assert.AreEqual(Enumerations.DoorState.CLOSED, logs[0].Device?.DoorState);
|
||||
Assert.AreEqual(DoorState.CLOSED, logs[0].Device?.DoorState);
|
||||
}
|
||||
|
||||
[TestMethod]
|
||||
@@ -136,14 +129,14 @@ namespace Aperio_Control_Centre.UnitTest.AperioServer
|
||||
|
||||
AperioDoor device = CreateAperioDoor();
|
||||
|
||||
Assert.AreEqual(Enumerations.LockState.UNKNOWN, device.LockState);
|
||||
Assert.AreEqual(LockState.UNKNOWN, device.LockState);
|
||||
|
||||
Task.Run(async () =>
|
||||
{
|
||||
await device.SetLockState(Enumerations.LockState.JAMMED, _token);
|
||||
await device.SetLockState(LockState.JAMMED, _token);
|
||||
}).GetAwaiter().GetResult();
|
||||
|
||||
Assert.AreEqual(Enumerations.LockState.JAMMED, device.LockState);
|
||||
Assert.AreEqual(LockState.JAMMED, device.LockState);
|
||||
|
||||
Assert.IsEmpty(_statusBroadcast.Messages);
|
||||
Assert.IsEmpty(_screenLogging.Messages);
|
||||
@@ -157,7 +150,7 @@ namespace Aperio_Control_Centre.UnitTest.AperioServer
|
||||
Assert.IsNotNull(logs);
|
||||
Assert.AreEqual("Slot geblokkeerd", logs[0].Message);
|
||||
|
||||
Assert.AreEqual(Enumerations.LockState.JAMMED, logs[0].Device?.LockState);
|
||||
Assert.AreEqual(LockState.JAMMED, logs[0].Device?.LockState);
|
||||
}
|
||||
|
||||
|
||||
@@ -169,7 +162,7 @@ namespace Aperio_Control_Centre.UnitTest.AperioServer
|
||||
|
||||
AperioDoor device = CreateAperioDoor();
|
||||
|
||||
Assert.AreEqual(Enumerations.DoorMode.UNKNOWN, device.GetDoorMode());
|
||||
Assert.AreEqual(DoorMode.UNKNOWN, device.GetDoorMode());
|
||||
}
|
||||
|
||||
[TestMethod]
|
||||
@@ -180,9 +173,9 @@ namespace Aperio_Control_Centre.UnitTest.AperioServer
|
||||
|
||||
AperioDoor device = CreateAperioDoor();
|
||||
|
||||
device.SetDoorMode(Enumerations.DoorMode.INSIDEOUT_LOCKED, _token).Wait(_token);
|
||||
device.SetDoorMode(DoorMode.INSIDEOUT_LOCKED, _token).Wait(_token);
|
||||
|
||||
Assert.AreEqual(Enumerations.DoorMode.INSIDEOUT_LOCKED, device.GetDoorMode());
|
||||
Assert.AreEqual(DoorMode.INSIDEOUT_LOCKED, device.GetDoorMode());
|
||||
}
|
||||
|
||||
[TestMethod]
|
||||
@@ -196,13 +189,13 @@ namespace Aperio_Control_Centre.UnitTest.AperioServer
|
||||
List<DoorMode> modes = [DoorMode.FREE_OPEN, DoorMode.RESTRICTED_LOCKED, DoorMode.RESTRICTED_SECURED];
|
||||
|
||||
device.UpdateDoormodes(modes, _token).Wait(_token);
|
||||
Assert.AreEqual(Enumerations.DoorMode.UNKNOWN, device.GetDoorMode());
|
||||
Assert.AreEqual(DoorMode.UNKNOWN, device.GetDoorMode());
|
||||
|
||||
device.SetDoorMode(Enumerations.DoorMode.INSIDEOUT_LOCKED, _token).Wait(_token);
|
||||
Assert.AreEqual(Enumerations.DoorMode.INSIDEOUT_LOCKED, device.GetDoorMode());
|
||||
device.SetDoorMode(DoorMode.INSIDEOUT_LOCKED, _token).Wait(_token);
|
||||
Assert.AreEqual(DoorMode.INSIDEOUT_LOCKED, device.GetDoorMode());
|
||||
|
||||
device.SetDoorMode(Enumerations.DoorMode.RESTRICTED_SECURED, _token).Wait(_token);
|
||||
Assert.AreEqual(Enumerations.DoorMode.RESTRICTED_SECURED, device.GetDoorMode());
|
||||
device.SetDoorMode(DoorMode.RESTRICTED_SECURED, _token).Wait(_token);
|
||||
Assert.AreEqual(DoorMode.RESTRICTED_SECURED, device.GetDoorMode());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,9 +1,7 @@
|
||||
using Aperio_Control_Centre.Aadp;
|
||||
using Aperio_Control_Centre.Aadp.ApplicationTypes;
|
||||
using Aperio_Control_Centre.Aadp.Enumerations;
|
||||
using Aperio_Control_Centre.ACSDatabase;
|
||||
using Aperio_Control_Centre.ACSDatabase.Models;
|
||||
using Aperio_Control_Centre.ACSDatabase.Types;
|
||||
using Aperio_Control_Centre.AperioServer;
|
||||
using Aperio_Control_Centre.AperioServer.Devices;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
|
||||
@@ -70,7 +68,7 @@ namespace Aperio_Control_Centre.UnitTest.AperioServer
|
||||
Assert.IsNotNull(device.Connection);
|
||||
Assert.AreEqual("64.226.1.0", device.IPAddress);
|
||||
Assert.AreEqual(ConnectionStates.Offline, device.ConnectionState);
|
||||
Assert.AreEqual(Enumerations.TamperState.UNKNOWN, device.TamperState);
|
||||
Assert.AreEqual(TamperState.UNKNOWN, device.TamperState);
|
||||
Assert.AreEqual(4, device.DataBaseDeviceID);
|
||||
|
||||
|
||||
@@ -93,7 +91,7 @@ namespace Aperio_Control_Centre.UnitTest.AperioServer
|
||||
Assert.IsNull(logs[0].Device?.LocationId);
|
||||
Assert.AreEqual("64.226.1.0", logs[0].Device?.Ipaddress);
|
||||
Assert.AreEqual(ActiveStates.Active, logs[0].Device?.Active);
|
||||
Assert.AreEqual(Enumerations.ProductClass.GATEWAY, logs[0].Device?.ProductClass);
|
||||
Assert.AreEqual(ProductClass.GATEWAY, logs[0].Device?.ProductClass);
|
||||
}
|
||||
|
||||
[TestMethod]
|
||||
@@ -108,7 +106,7 @@ namespace Aperio_Control_Centre.UnitTest.AperioServer
|
||||
|
||||
Assert.AreEqual("445566", device.Id);
|
||||
Assert.AreEqual(ConnectionStates.Offline, device.ConnectionState);
|
||||
Assert.AreEqual(Enumerations.TamperState.UNKNOWN, device.TamperState);
|
||||
Assert.AreEqual(TamperState.UNKNOWN, device.TamperState);
|
||||
Assert.IsNotNull(device.Connection);
|
||||
Assert.AreEqual("64.226.1.0", device.IPAddress);
|
||||
Assert.AreEqual(2, device.DataBaseDeviceID);
|
||||
|
||||
@@ -1,9 +1,7 @@
|
||||
using Aperio_Control_Centre.Aadp;
|
||||
using Aperio_Control_Centre.Aadp.ApplicationTypes;
|
||||
using Aperio_Control_Centre.Aadp.Enumerations;
|
||||
using Aperio_Control_Centre.ACSDatabase;
|
||||
using Aperio_Control_Centre.ACSDatabase.Models;
|
||||
using Aperio_Control_Centre.ACSDatabase.Types;
|
||||
using Aperio_Control_Centre.AperioServer;
|
||||
using Aperio_Control_Centre.AperioServer.Devices;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
|
||||
@@ -28,18 +26,18 @@ namespace Aperio_Control_Centre.UnitTest.AperioServer
|
||||
Assert.AreEqual("64.226.1.0", lockDevice.IPAddress);
|
||||
Assert.AreEqual(ConnectionStates.Offline, lockDevice.ConnectionState);
|
||||
Assert.AreEqual(1, lockDevice.DataBaseDeviceID);
|
||||
Assert.AreEqual(Enumerations.Status.UNKNOWN, lockDevice.DeviceStatus);
|
||||
Assert.AreEqual(Status.UNKNOWN, lockDevice.DeviceStatus);
|
||||
|
||||
Assert.AreEqual(BatteryStates.Unknown, lockDevice.BatteryState);
|
||||
Assert.AreEqual(Enumerations.DoorMode.UNKNOWN, lockDevice.GetDoorMode());
|
||||
Assert.AreEqual(Enumerations.DoorState.UNKNOWN, lockDevice.DoorState);
|
||||
Assert.AreEqual(Enumerations.LockState.UNKNOWN, lockDevice.LockState);
|
||||
Assert.AreEqual(Enumerations.KeyCylinderState.UNKNOWN, lockDevice.KeyCylinderState);
|
||||
Assert.AreEqual(Enumerations.HandleState.UNKNOWN, lockDevice.HandleState);
|
||||
Assert.AreEqual(DoorMode.UNKNOWN, lockDevice.GetDoorMode());
|
||||
Assert.AreEqual(DoorState.UNKNOWN, lockDevice.DoorState);
|
||||
Assert.AreEqual(LockState.UNKNOWN, lockDevice.LockState);
|
||||
Assert.AreEqual(KeyCylinderState.UNKNOWN, lockDevice.KeyCylinderState);
|
||||
Assert.AreEqual(HandleState.UNKNOWN, lockDevice.HandleState);
|
||||
|
||||
Assert.AreEqual(string.Empty, lockDevice.FirmwareVersion);
|
||||
Assert.IsNull(lockDevice.HwVersion);
|
||||
Assert.AreEqual(Enumerations.LockVersions.UNKNOWN, lockDevice.LockVersion);
|
||||
Assert.AreEqual(LockVersions.UNKNOWN, lockDevice.LockVersion);
|
||||
|
||||
//Assert.ThrowsException<NotImplementedException>(() => lockDevice.EmergencyInsideState);
|
||||
//Assert.ThrowsException<NotImplementedException>(() => lockDevice.EmergencyOutsideState);
|
||||
@@ -138,7 +136,7 @@ namespace Aperio_Control_Centre.UnitTest.AperioServer
|
||||
context.Devices.Add(new()
|
||||
{
|
||||
DeviceId = "FFEECC",
|
||||
ProductClass = Enumerations.ProductClass.GATEWAY,
|
||||
ProductClass = ProductClass.GATEWAY,
|
||||
Ipaddress = device.IPAddress,
|
||||
Active = ActiveStates.Active,
|
||||
LocationId = 2
|
||||
@@ -212,14 +210,14 @@ namespace Aperio_Control_Centre.UnitTest.AperioServer
|
||||
|
||||
AperioLockDevice device = CreateAperioLockDevice();
|
||||
|
||||
Assert.AreEqual(Enumerations.DoorMode.UNKNOWN, device.GetDoorMode());
|
||||
Assert.AreEqual(DoorMode.UNKNOWN, device.GetDoorMode());
|
||||
|
||||
Task.Run(async () =>
|
||||
{
|
||||
await device.SetDoorMode(Enumerations.DoorMode.FREE_OPEN, _token);
|
||||
await device.SetDoorMode(DoorMode.FREE_OPEN, _token);
|
||||
}).GetAwaiter().GetResult();
|
||||
|
||||
Assert.AreEqual(Enumerations.DoorMode.FREE_OPEN, device.GetDoorMode());
|
||||
Assert.AreEqual(DoorMode.FREE_OPEN, device.GetDoorMode());
|
||||
|
||||
Assert.IsEmpty(_statusBroadcast.Messages);
|
||||
Assert.IsEmpty(_screenLogging.Messages);
|
||||
@@ -244,14 +242,14 @@ namespace Aperio_Control_Centre.UnitTest.AperioServer
|
||||
|
||||
AperioLockDevice device = CreateAperioLockDevice();
|
||||
|
||||
Assert.AreEqual(Enumerations.KeyCylinderState.UNKNOWN, device.KeyCylinderState);
|
||||
Assert.AreEqual(KeyCylinderState.UNKNOWN, device.KeyCylinderState);
|
||||
|
||||
Task.Run(async () =>
|
||||
{
|
||||
await device.SetKeyCylinderState(Enumerations.KeyCylinderState.USED, _token);
|
||||
await device.SetKeyCylinderState(KeyCylinderState.USED, _token);
|
||||
}).GetAwaiter().GetResult();
|
||||
|
||||
Assert.AreEqual(Enumerations.KeyCylinderState.USED, device.KeyCylinderState);
|
||||
Assert.AreEqual(KeyCylinderState.USED, device.KeyCylinderState);
|
||||
|
||||
Assert.IsEmpty(_statusBroadcast.Messages);
|
||||
|
||||
@@ -267,7 +265,7 @@ namespace Aperio_Control_Centre.UnitTest.AperioServer
|
||||
Assert.IsNotNull(logs);
|
||||
Assert.AreEqual("KeyCylinderState (USED)", logs[0].Message);
|
||||
|
||||
Assert.AreEqual(Enumerations.KeyCylinderState.USED, logs[0].Device?.KeyCylinderState);
|
||||
Assert.AreEqual(KeyCylinderState.USED, logs[0].Device?.KeyCylinderState);
|
||||
}
|
||||
|
||||
[TestMethod]
|
||||
@@ -278,14 +276,14 @@ namespace Aperio_Control_Centre.UnitTest.AperioServer
|
||||
|
||||
AperioLockDevice device = CreateAperioLockDevice();
|
||||
|
||||
Assert.AreEqual(Enumerations.HandleState.UNKNOWN, device.HandleState);
|
||||
Assert.AreEqual(HandleState.UNKNOWN, device.HandleState);
|
||||
|
||||
Task.Run(async () =>
|
||||
{
|
||||
await device.SetHandleState(Enumerations.HandleState.BOTH_USED, _token);
|
||||
await device.SetHandleState(HandleState.BOTH_USED, _token);
|
||||
}).GetAwaiter().GetResult();
|
||||
|
||||
Assert.AreEqual(Enumerations.HandleState.BOTH_USED, device.HandleState);
|
||||
Assert.AreEqual(HandleState.BOTH_USED, device.HandleState);
|
||||
|
||||
Assert.IsEmpty(_statusBroadcast.Messages);
|
||||
|
||||
@@ -301,7 +299,7 @@ namespace Aperio_Control_Centre.UnitTest.AperioServer
|
||||
Assert.IsNotNull(logs);
|
||||
Assert.AreEqual("HandleState (BOTH_USED)", logs[0].Message);
|
||||
|
||||
Assert.AreEqual(Enumerations.HandleState.BOTH_USED, logs[0].Device?.HandleState);
|
||||
Assert.AreEqual(HandleState.BOTH_USED, logs[0].Device?.HandleState);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
using Aperio_Control_Centre.Aadp;
|
||||
using Aperio_Control_Centre.Aadp.ApplicationTypes;
|
||||
using Aperio_Control_Centre.Aadp.Enumerations;
|
||||
using Aperio_Control_Centre.Aadp.Types.ApplicationTypes;
|
||||
using Aperio_Control_Centre.ACSDatabase;
|
||||
using Aperio_Control_Centre.ACSDatabase.Models;
|
||||
using Aperio_Control_Centre.ACSDatabase.Types;
|
||||
@@ -23,7 +23,7 @@ namespace Aperio_Control_Centre.UnitTest.AperioServer
|
||||
Assert.IsNotNull(_statusBroadcast);
|
||||
Assert.IsNotNull(_dbContextFactory);
|
||||
|
||||
_deviceDefinition = new("0412F5", "0055FF", Enumerations.ProductClass.OPTA_V1);
|
||||
_deviceDefinition = new("0412F5", "0055FF", ProductClass.OPTA_V1);
|
||||
|
||||
_aperioConnectionContext.Features.Set<IScreenLogger>(_screenLogging);
|
||||
|
||||
@@ -35,7 +35,7 @@ namespace Aperio_Control_Centre.UnitTest.AperioServer
|
||||
Assert.AreEqual("64.226.1.0", optaDevice.IPAddress);
|
||||
Assert.AreEqual(ConnectionStates.Offline, optaDevice.ConnectionState);
|
||||
Assert.AreEqual(3, optaDevice.DataBaseDeviceID);
|
||||
Assert.AreEqual(Enumerations.Status.UNKNOWN, optaDevice.DeviceStatus);
|
||||
Assert.AreEqual(Status.UNKNOWN, optaDevice.DeviceStatus);
|
||||
|
||||
//Assert.ThrowsException<NotSupportedException>(() => optaDevice.HubDeviceId);
|
||||
//Assert.ThrowsException<NotSupportedException>(() => optaDevice.GetBatteryState(), "GetBatteryState");
|
||||
@@ -44,10 +44,10 @@ namespace Aperio_Control_Centre.UnitTest.AperioServer
|
||||
//Assert.ThrowsException<NotSupportedException>(() => optaDevice.GetHandleState());
|
||||
//Assert.ThrowsException<NotSupportedException>(() => optaDevice.LockVersion);
|
||||
|
||||
Assert.AreEqual(Enumerations.DoorState.UNKNOWN, optaDevice.DoorState);
|
||||
Assert.AreEqual(Enumerations.LockState.UNKNOWN, optaDevice.LockState);
|
||||
Assert.AreEqual(DoorState.UNKNOWN, optaDevice.DoorState);
|
||||
Assert.AreEqual(LockState.UNKNOWN, optaDevice.LockState);
|
||||
|
||||
Assert.AreEqual(Enumerations.TamperState.UNKNOWN, optaDevice.TamperState);
|
||||
Assert.AreEqual(TamperState.UNKNOWN, optaDevice.TamperState);
|
||||
|
||||
Assert.AreEqual(string.Empty, optaDevice.FirmwareVersion);
|
||||
Assert.IsNull(optaDevice.HwVersion);
|
||||
@@ -58,9 +58,9 @@ namespace Aperio_Control_Centre.UnitTest.AperioServer
|
||||
//Assert.AreEqual(PCBIdentity.OPTA_V1, optaDevice.HwVersion.PCBIdentity);
|
||||
|
||||
|
||||
Assert.AreEqual(Enumerations.ActivatorState.UNKNOWN, optaDevice.EmergencyInsideState);
|
||||
Assert.AreEqual(Enumerations.ActivatorState.UNKNOWN, optaDevice.EmergencyOutsideState);
|
||||
Assert.AreEqual(Enumerations.ActivatorState.UNKNOWN, optaDevice.ManualOpenState);
|
||||
Assert.AreEqual(ActivatorState.UNKNOWN, optaDevice.EmergencyInsideState);
|
||||
Assert.AreEqual(ActivatorState.UNKNOWN, optaDevice.EmergencyOutsideState);
|
||||
Assert.AreEqual(ActivatorState.UNKNOWN, optaDevice.ManualOpenState);
|
||||
|
||||
|
||||
Assert.IsEmpty(_screenLogging.Messages);
|
||||
@@ -145,15 +145,15 @@ namespace Aperio_Control_Centre.UnitTest.AperioServer
|
||||
AperioOptaDevice device = CreateOptaDevice();
|
||||
Assert.IsNotNull(_deviceDefinition);
|
||||
|
||||
Assert.AreEqual(Enumerations.ActivatorState.UNKNOWN, device.EmergencyInsideState);
|
||||
Assert.AreEqual(Enumerations.ActivatorState.UNKNOWN, device.EmergencyOutsideState);
|
||||
Assert.AreEqual(Enumerations.ActivatorState.UNKNOWN, device.ManualOpenState);
|
||||
Assert.AreEqual(ActivatorState.UNKNOWN, device.EmergencyInsideState);
|
||||
Assert.AreEqual(ActivatorState.UNKNOWN, device.EmergencyOutsideState);
|
||||
Assert.AreEqual(ActivatorState.UNKNOWN, device.ManualOpenState);
|
||||
|
||||
ActivatorInfo activatorInfo = new()
|
||||
{
|
||||
DeviceIdentity = _deviceDefinition.DeviceIdentity,
|
||||
ActivatorId = new((int)ActivatorTypes.EmergencyInside),
|
||||
ActivatorState = Enumerations.ActivatorState.USED
|
||||
ActivatorState = ActivatorState.USED
|
||||
};
|
||||
|
||||
Task.Run(async () =>
|
||||
@@ -161,9 +161,9 @@ namespace Aperio_Control_Centre.UnitTest.AperioServer
|
||||
await device.UpdateActivatorState(activatorInfo, _token);
|
||||
}).GetAwaiter().GetResult();
|
||||
|
||||
Assert.AreEqual(Enumerations.ActivatorState.USED, device.EmergencyInsideState);
|
||||
Assert.AreEqual(Enumerations.ActivatorState.UNKNOWN, device.EmergencyOutsideState);
|
||||
Assert.AreEqual(Enumerations.ActivatorState.UNKNOWN, device.ManualOpenState);
|
||||
Assert.AreEqual(ActivatorState.USED, device.EmergencyInsideState);
|
||||
Assert.AreEqual(ActivatorState.UNKNOWN, device.EmergencyOutsideState);
|
||||
Assert.AreEqual(ActivatorState.UNKNOWN, device.ManualOpenState);
|
||||
|
||||
Assert.HasCount(1, _statusBroadcast.Messages);
|
||||
Assert.AreEqual("SendEmergencyStatus 0412F5 EmergencyInside USED", _statusBroadcast.Messages[0]);
|
||||
@@ -189,15 +189,15 @@ namespace Aperio_Control_Centre.UnitTest.AperioServer
|
||||
AperioOptaDevice device = CreateOptaDevice();
|
||||
Assert.IsNotNull(_deviceDefinition);
|
||||
|
||||
Assert.AreEqual(Enumerations.ActivatorState.UNKNOWN, device.EmergencyInsideState);
|
||||
Assert.AreEqual(Enumerations.ActivatorState.UNKNOWN, device.EmergencyOutsideState);
|
||||
Assert.AreEqual(Enumerations.ActivatorState.UNKNOWN, device.ManualOpenState);
|
||||
Assert.AreEqual(ActivatorState.UNKNOWN, device.EmergencyInsideState);
|
||||
Assert.AreEqual(ActivatorState.UNKNOWN, device.EmergencyOutsideState);
|
||||
Assert.AreEqual(ActivatorState.UNKNOWN, device.ManualOpenState);
|
||||
|
||||
ActivatorInfo activatorInfo = new()
|
||||
{
|
||||
DeviceIdentity = _deviceDefinition.DeviceIdentity,
|
||||
ActivatorId = new((int)ActivatorTypes.EmergencyOutside),
|
||||
ActivatorState = Enumerations.ActivatorState.USED
|
||||
ActivatorState = ActivatorState.USED
|
||||
};
|
||||
|
||||
Task.Run(async () =>
|
||||
@@ -205,9 +205,9 @@ namespace Aperio_Control_Centre.UnitTest.AperioServer
|
||||
await device.UpdateActivatorState(activatorInfo, _token);
|
||||
}).GetAwaiter().GetResult();
|
||||
|
||||
Assert.AreEqual(Enumerations.ActivatorState.UNKNOWN, device.EmergencyInsideState);
|
||||
Assert.AreEqual(Enumerations.ActivatorState.USED, device.EmergencyOutsideState);
|
||||
Assert.AreEqual(Enumerations.ActivatorState.UNKNOWN, device.ManualOpenState);
|
||||
Assert.AreEqual(ActivatorState.UNKNOWN, device.EmergencyInsideState);
|
||||
Assert.AreEqual(ActivatorState.USED, device.EmergencyOutsideState);
|
||||
Assert.AreEqual(ActivatorState.UNKNOWN, device.ManualOpenState);
|
||||
|
||||
Assert.HasCount(1, _statusBroadcast.Messages);
|
||||
Assert.AreEqual("SendEmergencyStatus 0412F5 EmergencyOutside USED", _statusBroadcast.Messages[0]);
|
||||
@@ -233,15 +233,15 @@ namespace Aperio_Control_Centre.UnitTest.AperioServer
|
||||
AperioOptaDevice device = CreateOptaDevice();
|
||||
Assert.IsNotNull(_deviceDefinition);
|
||||
|
||||
Assert.AreEqual(Enumerations.ActivatorState.UNKNOWN, device.EmergencyInsideState);
|
||||
Assert.AreEqual(Enumerations.ActivatorState.UNKNOWN, device.EmergencyOutsideState);
|
||||
Assert.AreEqual(Enumerations.ActivatorState.UNKNOWN, device.ManualOpenState);
|
||||
Assert.AreEqual(ActivatorState.UNKNOWN, device.EmergencyInsideState);
|
||||
Assert.AreEqual(ActivatorState.UNKNOWN, device.EmergencyOutsideState);
|
||||
Assert.AreEqual(ActivatorState.UNKNOWN, device.ManualOpenState);
|
||||
|
||||
ActivatorInfo activatorInfo = new()
|
||||
{
|
||||
DeviceIdentity = _deviceDefinition.DeviceIdentity,
|
||||
ActivatorId = new((int)ActivatorTypes.ManualOpen),
|
||||
ActivatorState = Enumerations.ActivatorState.USED
|
||||
ActivatorState = ActivatorState.USED
|
||||
};
|
||||
|
||||
Task.Run(async () =>
|
||||
@@ -249,9 +249,9 @@ namespace Aperio_Control_Centre.UnitTest.AperioServer
|
||||
await device.UpdateActivatorState(activatorInfo, _token);
|
||||
}).GetAwaiter().GetResult();
|
||||
|
||||
Assert.AreEqual(Enumerations.ActivatorState.UNKNOWN, device.EmergencyInsideState);
|
||||
Assert.AreEqual(Enumerations.ActivatorState.UNKNOWN, device.EmergencyOutsideState);
|
||||
Assert.AreEqual(Enumerations.ActivatorState.USED, device.ManualOpenState);
|
||||
Assert.AreEqual(ActivatorState.UNKNOWN, device.EmergencyInsideState);
|
||||
Assert.AreEqual(ActivatorState.UNKNOWN, device.EmergencyOutsideState);
|
||||
Assert.AreEqual(ActivatorState.USED, device.ManualOpenState);
|
||||
|
||||
Assert.IsEmpty(_statusBroadcast.Messages);
|
||||
//Assert.AreEqual("SendEmergencyStatus 0412F5 EmergencyOutside USED", _statusBroadcast.Messages[0]);
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
using Aperio_Control_Centre.Aadp;
|
||||
using Aperio_Control_Centre.ACSDatabase.Types;
|
||||
using Aperio_Control_Centre.ACSDatabase.Types;
|
||||
using Aperio_Control_Centre.ACSDatabase.Models;
|
||||
using Aperio_Control_Centre.ACSDatabase;
|
||||
using Microsoft.Extensions.Logging;
|
||||
@@ -11,6 +10,7 @@ using Aperio_Control_Centre.StatusBroadcast;
|
||||
using Microsoft.AspNetCore.Connections;
|
||||
using System.Net;
|
||||
using Microsoft.Extensions.Configuration;
|
||||
using Aperio_Control_Centre.Aadp.Enumerations;
|
||||
|
||||
namespace Aperio_Control_Centre.UnitTest.AperioServer
|
||||
{
|
||||
@@ -85,7 +85,7 @@ namespace Aperio_Control_Centre.UnitTest.AperioServer
|
||||
Active = ActiveStates.Active,
|
||||
ConnectionState = ConnectionStates.Online,
|
||||
Ipaddress = "64.226.1.0",
|
||||
ProductClass = Enumerations.ProductClass.LOCK,
|
||||
ProductClass = ProductClass.LOCK,
|
||||
});
|
||||
dbContext.Devices.Add(new Device()
|
||||
{
|
||||
@@ -93,7 +93,7 @@ namespace Aperio_Control_Centre.UnitTest.AperioServer
|
||||
DeviceId = "445566",
|
||||
Name = "TestHost 2",
|
||||
Active = ActiveStates.Active,
|
||||
ProductClass = Enumerations.ProductClass.GATEWAY,
|
||||
ProductClass = ProductClass.GATEWAY,
|
||||
Ipaddress = "64.226.1.0",
|
||||
LocationId = 1
|
||||
});
|
||||
@@ -104,7 +104,7 @@ namespace Aperio_Control_Centre.UnitTest.AperioServer
|
||||
Name = "Opta lock",
|
||||
Active = ActiveStates.Active,
|
||||
ConnectionState = ConnectionStates.Online,
|
||||
ProductClass = Enumerations.ProductClass.OPTA_V1,
|
||||
ProductClass = ProductClass.OPTA_V1,
|
||||
//Ipaddress = "[::ffff:192.168.0.172]:49494",
|
||||
Ipaddress = "64.226.1.0",
|
||||
LocationId = 1,
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
using Aperio_Control_Centre.Aadp;
|
||||
using Aperio_Control_Centre.Aadp.ApplicationTypes;
|
||||
using Aperio_Control_Centre.Aadp.Enumerations;
|
||||
using Aperio_Control_Centre.Aadp.Types.ApplicationTypes;
|
||||
using Aperio_Control_Centre.ACSDatabase.Types;
|
||||
using Aperio_Control_Centre.AperioServer;
|
||||
using Aperio_Control_Centre.AperioServer.Devices;
|
||||
@@ -28,7 +28,7 @@ namespace Aperio_Control_Centre.UnitTest.AperioServer
|
||||
Assert.IsNotNull(_statusBroadcast);
|
||||
|
||||
IAperioBase device;
|
||||
DeviceDefinition deviceDefinition = new("112233", "445566", Enumerations.ProductClass.LOCK);
|
||||
DeviceDefinition deviceDefinition = new("112233", "445566", ProductClass.LOCK);
|
||||
|
||||
Task.Run(async () =>
|
||||
{
|
||||
@@ -92,7 +92,7 @@ namespace Aperio_Control_Centre.UnitTest.AperioServer
|
||||
Assert.AreEqual(0, _devicesList.GetConnections().Count());
|
||||
Assert.AreEqual(0, _devicesList.GetDevices().Count());
|
||||
|
||||
DeviceDefinition deviceDefinition = new("0392BC", "0412F5", Enumerations.ProductClass.LOCK);
|
||||
DeviceDefinition deviceDefinition = new("0392BC", "0412F5", ProductClass.LOCK);
|
||||
|
||||
Task.Run(async () =>
|
||||
{
|
||||
@@ -146,7 +146,7 @@ namespace Aperio_Control_Centre.UnitTest.AperioServer
|
||||
Assert.AreEqual(0, _devicesList.GetConnections().Count());
|
||||
Assert.AreEqual(0, _devicesList.GetDevices().Count());
|
||||
|
||||
DeviceDefinition deviceDefinition = new("AA11BB", "445566", Enumerations.ProductClass.LOCK);
|
||||
DeviceDefinition deviceDefinition = new("AA11BB", "445566", ProductClass.LOCK);
|
||||
|
||||
Task.Run(async () =>
|
||||
{
|
||||
@@ -333,7 +333,7 @@ namespace Aperio_Control_Centre.UnitTest.AperioServer
|
||||
bool fired = false;
|
||||
_devicesList.DeviceListChanged += (s, e) => { fired = true; };
|
||||
|
||||
DeviceDefinition deviceDefinition = new("0392BC", "0412F5", Enumerations.ProductClass.GATEWAY);
|
||||
DeviceDefinition deviceDefinition = new("0392BC", "0412F5", ProductClass.GATEWAY);
|
||||
|
||||
Task.Run(async () =>
|
||||
{
|
||||
@@ -360,7 +360,7 @@ namespace Aperio_Control_Centre.UnitTest.AperioServer
|
||||
Task.Run(async () =>
|
||||
{
|
||||
//await _devicesList.UpdateConnectionState(_connectionMoq.Object, Enumerations.Status.OK, _token);
|
||||
await _devicesList.UpdateConnectionState(_aperioConnectionContext, Enumerations.Status.OK, _token);
|
||||
await _devicesList.UpdateConnectionState(_aperioConnectionContext, Status.OK, _token);
|
||||
}).Wait();
|
||||
|
||||
//gateway status update
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
using Aperio_Control_Centre.Aadp;
|
||||
using Aperio_Control_Centre.Aadp.Enumerations;
|
||||
using Aperio_Control_Centre.ACSDatabase.Models;
|
||||
using Aperio_Control_Centre.ACSDatabase.Types;
|
||||
using Aperio_Control_Centre.Api;
|
||||
@@ -17,7 +17,7 @@ namespace Aperio_Control_Centre.UnitTest.ApiTest
|
||||
{
|
||||
//Assert.IsNotNull(_screenLogging);
|
||||
|
||||
LogDataModel requestModel = new() { ProductClass = (Enumerations.ProductClass)100 };
|
||||
LogDataModel requestModel = new() { ProductClass = (ProductClass)100 };
|
||||
JsonResult result = _apiController.AddLog(requestModel, _token).Result;
|
||||
|
||||
//jsonresult
|
||||
@@ -35,7 +35,7 @@ namespace Aperio_Control_Centre.UnitTest.ApiTest
|
||||
Assert.IsNotNull(_screenLogging);
|
||||
Assert.IsNotNull(_dbContextFactory);
|
||||
|
||||
LogDataModel requestModel = new() { ProductClass = Enumerations.ProductClass.H1502R11, Name = "Test", Message = "Test" };
|
||||
LogDataModel requestModel = new() { ProductClass = ProductClass.H1502R11, Name = "Test", Message = "Test" };
|
||||
JsonResult result = _apiController.AddLog(requestModel, _token).Result;
|
||||
|
||||
//jsonresult
|
||||
@@ -50,7 +50,7 @@ namespace Aperio_Control_Centre.UnitTest.ApiTest
|
||||
[TestMethod]
|
||||
public void AddLog_EmptyName()
|
||||
{
|
||||
LogDataModel requestModel = new() { ProductClass = Enumerations.ProductClass.H1502R11, Device = "Test", Message = "Test" };
|
||||
LogDataModel requestModel = new() { ProductClass = ProductClass.H1502R11, Device = "Test", Message = "Test" };
|
||||
JsonResult result = _apiController.AddLog(requestModel, _token).Result;
|
||||
|
||||
//jsonresult
|
||||
@@ -65,7 +65,7 @@ namespace Aperio_Control_Centre.UnitTest.ApiTest
|
||||
[TestMethod]
|
||||
public void AddLog_EmptyMessage()
|
||||
{
|
||||
LogDataModel requestModel = new() { ProductClass = Enumerations.ProductClass.H1502R11, Device = "Test", Name = "Test" };
|
||||
LogDataModel requestModel = new() { ProductClass = ProductClass.H1502R11, Device = "Test", Name = "Test" };
|
||||
JsonResult result = _apiController.AddLog(requestModel, _token).Result;
|
||||
|
||||
//jsonresult
|
||||
@@ -85,7 +85,7 @@ namespace Aperio_Control_Centre.UnitTest.ApiTest
|
||||
|
||||
LogDataModel requestModel = new()
|
||||
{
|
||||
ProductClass = Enumerations.ProductClass.H1502R11,
|
||||
ProductClass = ProductClass.H1502R11,
|
||||
Device = "Billy",
|
||||
Name = "Some door",
|
||||
Message = "Hello world",
|
||||
@@ -193,7 +193,7 @@ namespace Aperio_Control_Centre.UnitTest.ApiTest
|
||||
|
||||
LogDataModel requestModel = new()
|
||||
{
|
||||
ProductClass = Enumerations.ProductClass.H1502R11,
|
||||
ProductClass = ProductClass.H1502R11,
|
||||
Device = "112233",
|
||||
Name = "Active Device",
|
||||
Message = "Hello world",
|
||||
|
||||
@@ -11,6 +11,7 @@ using Aperio_Control_Centre.StatusBroadcast;
|
||||
using System.Net;
|
||||
using Microsoft.AspNetCore.Http;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using Aperio_Control_Centre.Aadp.Enumerations;
|
||||
|
||||
namespace Aperio_Control_Centre.UnitTest.ApiTest
|
||||
{
|
||||
@@ -70,7 +71,7 @@ namespace Aperio_Control_Centre.UnitTest.ApiTest
|
||||
ConnectionState = ConnectionStates.Online,
|
||||
Ipaddress = "11.22.33.44",
|
||||
UnlockTime = 50,
|
||||
ProductClass = Aadp.Enumerations.ProductClass.H1502R11
|
||||
ProductClass = ProductClass.H1502R11
|
||||
});
|
||||
_ = dbContext.Devices.Add(new Device()
|
||||
{
|
||||
|
||||
@@ -4,7 +4,7 @@ using Aperio_Control_Centre.Api.Types;
|
||||
using Aperio_Control_Centre.ACSDatabase.Models;
|
||||
using Aperio_Control_Centre.ACSDatabase.Types;
|
||||
using System.Net;
|
||||
using Aperio_Control_Centre.Aadp;
|
||||
using Aperio_Control_Centre.Aadp.Enumerations;
|
||||
|
||||
namespace Aperio_Control_Centre.UnitTest.ApiTest
|
||||
{
|
||||
@@ -41,7 +41,7 @@ namespace Aperio_Control_Centre.UnitTest.ApiTest
|
||||
{
|
||||
Assert.IsNotNull(_screenLogging);
|
||||
|
||||
CredentialRequestModel requestModel = new() { ProductClass = (Enumerations.ProductClass)100 };
|
||||
CredentialRequestModel requestModel = new() { ProductClass = (ProductClass)100 };
|
||||
JsonResult result = _apiController.CredentialRequest(requestModel, _token).Result;
|
||||
|
||||
Assert.IsNotNull(result);
|
||||
@@ -65,7 +65,7 @@ namespace Aperio_Control_Centre.UnitTest.ApiTest
|
||||
{
|
||||
Assert.IsNotNull(_screenLogging);
|
||||
|
||||
CredentialRequestModel requestModel = new() { Device = "", ProductClass = Enumerations.ProductClass.H1502R11 };
|
||||
CredentialRequestModel requestModel = new() { Device = "", ProductClass = ProductClass.H1502R11 };
|
||||
JsonResult result = _apiController.CredentialRequest(requestModel, _token).Result;
|
||||
|
||||
Assert.IsNotNull(result);
|
||||
@@ -96,7 +96,7 @@ namespace Aperio_Control_Centre.UnitTest.ApiTest
|
||||
Name = "Unknown",
|
||||
Reader = 1,
|
||||
ReaderName = "Reader 1",
|
||||
ProductClass = Enumerations.ProductClass.H1502R11,
|
||||
ProductClass = ProductClass.H1502R11,
|
||||
ReaderData = "E2C9FBA004090900010000000000000000000000B3DC49B384C1D5F34C8E232316D65821"
|
||||
};
|
||||
JsonResult result = _apiController.CredentialRequest(credentialRequest, _token).Result;
|
||||
@@ -215,7 +215,7 @@ namespace Aperio_Control_Centre.UnitTest.ApiTest
|
||||
Name = "NAME",
|
||||
Reader = 1,
|
||||
ReaderName = "Reader 1",
|
||||
ProductClass = Enumerations.ProductClass.H1502R11,
|
||||
ProductClass = ProductClass.H1502R11,
|
||||
ReaderData = "E2C9FBA004090900010000000000000000000000B3DC49B384C1D5F34C8E232316D65821"
|
||||
};
|
||||
JsonResult result = _apiController.CredentialRequest(credentialRequest, _token).Result;
|
||||
@@ -291,7 +291,7 @@ namespace Aperio_Control_Centre.UnitTest.ApiTest
|
||||
Name = "NAME",
|
||||
Reader = 1,
|
||||
ReaderName = "Reader 1",
|
||||
ProductClass = Enumerations.ProductClass.H1502R11,
|
||||
ProductClass = ProductClass.H1502R11,
|
||||
ReaderData = "E2C9FBA0040909000100000B3DC49B384C1D5F34C8E232316D65821"
|
||||
};
|
||||
JsonResult result = _apiController.CredentialRequest(credentialRequest, _token).Result;
|
||||
@@ -401,7 +401,7 @@ namespace Aperio_Control_Centre.UnitTest.ApiTest
|
||||
Name = "NAME",
|
||||
Reader = 1,
|
||||
ReaderName = "Reader 1",
|
||||
ProductClass = Enumerations.ProductClass.H1502R11,
|
||||
ProductClass = ProductClass.H1502R11,
|
||||
ReaderData = "12AB34CD040909000100000000000000000000001AD110B5D0E89CD887308C993A449E05"
|
||||
};
|
||||
JsonResult result = _apiController.CredentialRequest(credentialRequest, _token).Result;
|
||||
@@ -511,7 +511,7 @@ namespace Aperio_Control_Centre.UnitTest.ApiTest
|
||||
Name = "NAME",
|
||||
Reader = 1,
|
||||
ReaderName = "Reader 1",
|
||||
ProductClass = Enumerations.ProductClass.H1502R11,
|
||||
ProductClass = ProductClass.H1502R11,
|
||||
ReaderData = "E2C9FBA0040909000100000000000000000000001XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
|
||||
};
|
||||
JsonResult result = _apiController.CredentialRequest(credentialRequest, _token).Result;
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
using Aperio_Control_Centre.Api.Types;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using System.Net;
|
||||
using Aperio_Control_Centre.Aadp;
|
||||
using Aperio_Control_Centre.Aadp.Enumerations;
|
||||
|
||||
namespace Aperio_Control_Centre.UnitTest.ApiTest
|
||||
{
|
||||
@@ -26,7 +26,7 @@ namespace Aperio_Control_Centre.UnitTest.ApiTest
|
||||
[TestMethod]
|
||||
public void LockState_UndifinedLockState()
|
||||
{
|
||||
LockStateModel requestModel = new() { LockState = (Aadp.Enumerations.LockState)100 };
|
||||
LockStateModel requestModel = new() { LockState = (LockState)100 };
|
||||
JsonResult result = _apiController.LockState(requestModel, _token).Result;
|
||||
|
||||
//jsonresult
|
||||
@@ -41,7 +41,7 @@ namespace Aperio_Control_Centre.UnitTest.ApiTest
|
||||
[TestMethod]
|
||||
public void LockState_UndifinedProductclass()
|
||||
{
|
||||
LockStateModel requestModel = new() { ProductClass = (Enumerations.ProductClass)100 };
|
||||
LockStateModel requestModel = new() { ProductClass = (ProductClass)100 };
|
||||
JsonResult result = _apiController.LockState(requestModel, _token).Result;
|
||||
|
||||
//jsonresult
|
||||
@@ -92,8 +92,8 @@ namespace Aperio_Control_Centre.UnitTest.ApiTest
|
||||
{
|
||||
Device = "Billy",
|
||||
Name = "Some door",
|
||||
ProductClass = Enumerations.ProductClass.H1502R11,
|
||||
LockState = Aadp.Enumerations.LockState.UNKNOWN
|
||||
ProductClass = ProductClass.H1502R11,
|
||||
LockState = LockState.UNKNOWN
|
||||
};
|
||||
JsonResult result = _apiController.LockState(requestModel, _token).Result;
|
||||
|
||||
@@ -125,8 +125,8 @@ namespace Aperio_Control_Centre.UnitTest.ApiTest
|
||||
{
|
||||
Device = "Billy",
|
||||
Name = "Some door",
|
||||
ProductClass = Enumerations.ProductClass.H1502R11,
|
||||
LockState = Aadp.Enumerations.LockState.UNLOCKED
|
||||
ProductClass = ProductClass.H1502R11,
|
||||
LockState = LockState.UNLOCKED
|
||||
};
|
||||
JsonResult result = _apiController.LockState(requestModel, _token).Result;
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@ using Microsoft.AspNetCore.Mvc;
|
||||
using Aperio_Control_Centre.ACSDatabase;
|
||||
using Aperio_Control_Centre.ACSDatabase.Models;
|
||||
using Aperio_Control_Centre.ACSDatabase.Types;
|
||||
using Aperio_Control_Centre.Aadp;
|
||||
using Aperio_Control_Centre.Aadp.Enumerations;
|
||||
|
||||
namespace Aperio_Control_Centre.UnitTest.ApiTest
|
||||
{
|
||||
@@ -38,7 +38,7 @@ namespace Aperio_Control_Centre.UnitTest.ApiTest
|
||||
{
|
||||
Assert.IsNotNull(_screenLogging);
|
||||
|
||||
StatusModel requestModel = new() { ProductClass = (Enumerations.ProductClass)100 };
|
||||
StatusModel requestModel = new() { ProductClass = (ProductClass)100 };
|
||||
JsonResult result = _apiController.Status(requestModel, _token).Result;
|
||||
|
||||
Assert.IsNotNull(result);
|
||||
@@ -66,7 +66,7 @@ namespace Aperio_Control_Centre.UnitTest.ApiTest
|
||||
Name = "TEST",
|
||||
Device = "Test",
|
||||
Status = (ACSReaderStates)100,
|
||||
ProductClass = Enumerations.ProductClass.H1502R11
|
||||
ProductClass = ProductClass.H1502R11
|
||||
};
|
||||
JsonResult result = _apiController.Status(requestModel, _token).Result;
|
||||
|
||||
@@ -93,7 +93,7 @@ namespace Aperio_Control_Centre.UnitTest.ApiTest
|
||||
StatusModel requestModel = new()
|
||||
{
|
||||
Name = "TEST",
|
||||
ProductClass = Enumerations.ProductClass.H1502R11,
|
||||
ProductClass = ProductClass.H1502R11,
|
||||
Status = ACSReaderStates.Running
|
||||
};
|
||||
JsonResult result = _apiController.Status(requestModel, _token).Result;
|
||||
@@ -121,7 +121,7 @@ namespace Aperio_Control_Centre.UnitTest.ApiTest
|
||||
StatusModel requestModel = new()
|
||||
{
|
||||
Device = "TEST",
|
||||
ProductClass = Enumerations.ProductClass.H1502R11,
|
||||
ProductClass = ProductClass.H1502R11,
|
||||
Status = ACSReaderStates.Restart_Success
|
||||
};
|
||||
JsonResult result = _apiController.Status(requestModel, _token).Result;
|
||||
@@ -151,7 +151,7 @@ namespace Aperio_Control_Centre.UnitTest.ApiTest
|
||||
{
|
||||
Device = "112233",
|
||||
Name = "Active Device",
|
||||
ProductClass = Enumerations.ProductClass.H1502R11,
|
||||
ProductClass = ProductClass.H1502R11,
|
||||
Status = ACSReaderStates.Unknown
|
||||
};
|
||||
JsonResult result = _apiController.Status(requestModel, _token).Result;
|
||||
@@ -206,7 +206,7 @@ namespace Aperio_Control_Centre.UnitTest.ApiTest
|
||||
{
|
||||
Device = "112233",
|
||||
Name = "Active Device",
|
||||
ProductClass = Enumerations.ProductClass.H1502R11,
|
||||
ProductClass = ProductClass.H1502R11,
|
||||
Status = ACSReaderStates.Running
|
||||
};
|
||||
JsonResult result = _apiController.Status(requestModel, _token).Result;
|
||||
@@ -249,7 +249,7 @@ namespace Aperio_Control_Centre.UnitTest.ApiTest
|
||||
{
|
||||
Device = "445566",
|
||||
Name = "Offline Device",
|
||||
ProductClass = Enumerations.ProductClass.H1502R11,
|
||||
ProductClass = ProductClass.H1502R11,
|
||||
Status = ACSReaderStates.Running
|
||||
};
|
||||
JsonResult result = _apiController.Status(requestModel, _token).Result;
|
||||
@@ -307,7 +307,7 @@ namespace Aperio_Control_Centre.UnitTest.ApiTest
|
||||
{
|
||||
Device = "112233",
|
||||
Name = "Active Device",
|
||||
ProductClass = Enumerations.ProductClass.H1502R11,
|
||||
ProductClass = ProductClass.H1502R11,
|
||||
Status = ACSReaderStates.Stopped
|
||||
};
|
||||
JsonResult result = _apiController.Status(requestModel, _token).Result;
|
||||
@@ -378,7 +378,7 @@ namespace Aperio_Control_Centre.UnitTest.ApiTest
|
||||
{
|
||||
Device = "112233",
|
||||
Name = "Active Device",
|
||||
ProductClass = Enumerations.ProductClass.H1502R11,
|
||||
ProductClass = ProductClass.H1502R11,
|
||||
Status = ACSReaderStates.Restart_Success
|
||||
};
|
||||
JsonResult result = _apiController.Status(requestModel, _token).Result;
|
||||
@@ -437,7 +437,7 @@ namespace Aperio_Control_Centre.UnitTest.ApiTest
|
||||
{
|
||||
Device = "112233",
|
||||
Name = "Active Device",
|
||||
ProductClass = Enumerations.ProductClass.H1502R11,
|
||||
ProductClass = ProductClass.H1502R11,
|
||||
Status = ACSReaderStates.Restart_Failed
|
||||
};
|
||||
JsonResult result = _apiController.Status(requestModel, _token).Result;
|
||||
|
||||
@@ -5,7 +5,7 @@ using Microsoft.EntityFrameworkCore;
|
||||
using Moq;
|
||||
using Aperio_Control_Centre.ACSDatabase.Types;
|
||||
using System.Net;
|
||||
using Aperio_Control_Centre.Aadp;
|
||||
using Aperio_Control_Centre.Aadp.Enumerations;
|
||||
|
||||
namespace Aperio_Control_Centre.UnitTest.CredentialChecker
|
||||
{
|
||||
@@ -24,7 +24,7 @@ namespace Aperio_Control_Centre.UnitTest.CredentialChecker
|
||||
Name = "NAME",
|
||||
Reader = 1,
|
||||
ReaderName = "Reader 1",
|
||||
ProductClass = Enumerations.ProductClass.H1502R11,
|
||||
ProductClass = ProductClass.H1502R11,
|
||||
ReaderData = "635456474356745845634"
|
||||
};
|
||||
|
||||
@@ -74,7 +74,7 @@ namespace Aperio_Control_Centre.UnitTest.CredentialChecker
|
||||
Name = "NAME",
|
||||
Reader = 1,
|
||||
ReaderName = "Reader 1",
|
||||
ProductClass = Enumerations.ProductClass.H1502R11,
|
||||
ProductClass = ProductClass.H1502R11,
|
||||
ReaderData = "E2C9FBA0040x0900010000000000000000000000B3DC49B384C1D5F34C8E232316D65821"
|
||||
};
|
||||
|
||||
@@ -125,7 +125,7 @@ namespace Aperio_Control_Centre.UnitTest.CredentialChecker
|
||||
Name = "NAME",
|
||||
Reader = 1,
|
||||
ReaderName = "Reader 1",
|
||||
ProductClass = Enumerations.ProductClass.H1502R11,
|
||||
ProductClass = ProductClass.H1502R11,
|
||||
ReaderData = "E2C9FBA004090900010000000000000000000000B3DC49B384C1D5F34C8E232316D65821"
|
||||
};
|
||||
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
using Aperio_Control_Centre.Aadp.ApplicationTypes;
|
||||
using Aperio_Control_Centre.Aadp.Enumerations;
|
||||
using Aperio_Control_Centre.Aadp.Types.ApplicationTypes;
|
||||
using Aperio_Control_Centre.ACSDatabase;
|
||||
using Aperio_Control_Centre.ACSDatabase.Models;
|
||||
using Aperio_Control_Centre.ACSDatabase.Types;
|
||||
@@ -18,8 +19,8 @@ namespace Aperio_Control_Centre.UnitTest.CredentialChecker
|
||||
TestingScreenLogger screenLogging = new();
|
||||
CancellationToken token = new();
|
||||
|
||||
CredentialBlock mifareUID = new(Aadp.Enumerations.CredentialBlockType.MIFAREUID, [0x00, 0x01, 0x02, 0x03]);
|
||||
CredentialBlock dynamicData = new(Aadp.Enumerations.CredentialBlockType.DynamicData, [0x00, 0x01, 0x02, 0x03, 0x04, 0x05]);
|
||||
CredentialBlock mifareUID = new(CredentialBlockType.MIFAREUID, [0x00, 0x01, 0x02, 0x03]);
|
||||
CredentialBlock dynamicData = new(CredentialBlockType.DynamicData, [0x00, 0x01, 0x02, 0x03, 0x04, 0x05]);
|
||||
|
||||
ACSDatabaseContext db = _dbContextFactory.CreateDbContext();
|
||||
|
||||
@@ -61,8 +62,8 @@ namespace Aperio_Control_Centre.UnitTest.CredentialChecker
|
||||
TestingScreenLogger screenLogging = new();
|
||||
CancellationToken token = new();
|
||||
|
||||
CredentialBlock mifareUID = new(Aadp.Enumerations.CredentialBlockType.MIFAREUID, [0xDE, 0xAD, 0xBE, 0xEF]);
|
||||
CredentialBlock dynamicData = new(Aadp.Enumerations.CredentialBlockType.DynamicData, [0x05, 0x09, 0x09, 0x00, 0x01, 0x09, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xB3, 0xDC, 0x49, 0xB3, 0x84, 0xC1, 0xD5, 0xF3, 0x4C, 0x8E, 0x23, 0x23, 0x16, 0xD6, 0x58, 0x21]);
|
||||
CredentialBlock mifareUID = new(CredentialBlockType.MIFAREUID, [0xDE, 0xAD, 0xBE, 0xEF]);
|
||||
CredentialBlock dynamicData = new(CredentialBlockType.DynamicData, [0x05, 0x09, 0x09, 0x00, 0x01, 0x09, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xB3, 0xDC, 0x49, 0xB3, 0x84, 0xC1, 0xD5, 0xF3, 0x4C, 0x8E, 0x23, 0x23, 0x16, 0xD6, 0x58, 0x21]);
|
||||
|
||||
ACSDatabaseContext db = _dbContextFactory.CreateDbContext();
|
||||
|
||||
@@ -107,8 +108,8 @@ namespace Aperio_Control_Centre.UnitTest.CredentialChecker
|
||||
TestingScreenLogger screenLogging = new();
|
||||
CancellationToken token = new();
|
||||
|
||||
CredentialBlock mifareUID = new(Aadp.Enumerations.CredentialBlockType.MIFAREUID, [0xDE, 0xAD, 0xBE, 0xEF]);
|
||||
CredentialBlock dynamicData = new(Aadp.Enumerations.CredentialBlockType.DynamicData, [0x04, 0x09, 0x09, 0x00, 0x01, 0x09, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xB3, 0xDC, 0x49, 0xB3, 0x84, 0xC1, 0xD5, 0xF3, 0x4C, 0x8E, 0x23, 0x23, 0x16, 0xD6, 0x58, 0x21]);
|
||||
CredentialBlock mifareUID = new(CredentialBlockType.MIFAREUID, [0xDE, 0xAD, 0xBE, 0xEF]);
|
||||
CredentialBlock dynamicData = new(CredentialBlockType.DynamicData, [0x04, 0x09, 0x09, 0x00, 0x01, 0x09, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xB3, 0xDC, 0x49, 0xB3, 0x84, 0xC1, 0xD5, 0xF3, 0x4C, 0x8E, 0x23, 0x23, 0x16, 0xD6, 0x58, 0x21]);
|
||||
|
||||
ACSDatabaseContext db = _dbContextFactory.CreateDbContext();
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
using static Aperio_Control_Centre.Aadp.Enumerations;
|
||||
using Aperio_Control_Centre.Aadp.Enumerations;
|
||||
using Aperio_Control_Centre.ScreenLogging;
|
||||
using System.Net;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user