public DeviceShutdownStateActionTest() { mockController = new Mock <IDeviceStateController>(); subject = new DeviceShutdownStateAction(mockController.Object); asyncManager = new DeviceStateMachineAsyncManager(ref mockController, subject); }
public DeviceInitializeDeviceCommunicationStateActionTest() { linkRequest = new LinkRequest() { //LinkObjects = new LinkRequestIPA5Object //{ // LinkActionResponseList = new List<XO.Responses.LinkActionResponse>() //}, Actions = new List <LinkActionRequest>() { new LinkActionRequest() { MessageID = RandomGenerator.BuildRandomString(8), Timeout = 10000, DeviceRequest = new LinkDeviceRequest() { DeviceIdentifier = new LinkDeviceIdentifier() { Manufacturer = "DeviceMockerInc", Model = "DeviceMokerModel", SerialNumber = "CEEEDEADBEEF" } } } } }; deviceSection = new DeviceSection(); //mockLoggingClient = new Mock<ILoggingServiceClient>(); mockDevicePluginLoader = new Mock <IDevicePluginLoader>(); mockCancellationBroker = new Mock <IDeviceCancellationBroker>(); mockController = new Mock <IDeviceStateController>(); //mockController.SetupGet(e => e.LoggingClient).Returns(mockLoggingClient.Object); mockController.SetupGet(e => e.DevicePluginLoader).Returns(mockDevicePluginLoader.Object); mockController.SetupGet(e => e.Configuration).Returns(deviceSection); mockController.SetupGet(e => e.PluginPath).Returns(pluginPath); mockController.Setup(e => e.GetCancellationBroker()).Returns(mockCancellationBroker.Object); deviceInformation = new DeviceInformation() { Manufacturer = linkRequest.Actions[0].DeviceRequest.DeviceIdentifier.Manufacturer, Model = linkRequest.Actions[0].DeviceRequest.DeviceIdentifier.Model, SerialNumber = linkRequest.Actions[0].DeviceRequest.DeviceIdentifier.SerialNumber, }; fakeDeviceOne.Setup(e => e.DeviceInformation).Returns(deviceInformation); deviceInformation.SerialNumber = "CEEEBEEFDEAD"; fakeDeviceTwo.Setup(e => e.DeviceInformation).Returns(deviceInformation); moqCardDevices.AddRange(new ICardDevice[] { fakeDeviceOne.Object, fakeDeviceTwo.Object }); mockController.SetupGet(e => e.TargetDevices).Returns(moqCardDevices); subject = new DeviceInitializeDeviceCommunicationStateAction(mockController.Object); asyncManager = new DeviceStateMachineAsyncManager(ref mockController, subject); }
public DeviceInitializeDeviceHealthStateActionTest() { //mockLoggingClient = new Mock<ILoggingServiceClient>(); mockController = new Mock <IDeviceStateController>(); //mockController.SetupGet(e => e.LoggingClient).Returns(mockLoggingClient.Object); subject = new DeviceInitializeDeviceHealthStateAction(mockController.Object); asyncManager = new DeviceStateMachineAsyncManager(ref mockController, subject); }