public async Task Move_SlotInfoAndComputerInfo_CarouselShouldMove(bool isOutsideComputer) { IUtility utility = new Utility(); _carousel = new CarWhiteIpcDualAccess(controlType: ControllerType.WhiteIPCDualAccess, ipAddr: _carouselData.Attribute.IPAddress, carAddr: _carouselData.Attribute.DeviceNumber, port: _carouselData.Attribute.Port, timeOut: 10, returnsStatus: true, deviceResponse: _deviceResponse, socket: _socket); _carousel.Connect(); //Assume IDeviceResponse expected = new DeviceResponse() { HasError = false, Message = "Data is written on device successfully.", CurrentCarrier = 0 }; //Act IDeviceResponse actual = await _carousel.Move(slot : await utility.BuildStorageSpaceItem(_carouselData.StorageSpaces), isOutsideComputer : isOutsideComputer); _carousel.Disconnect(); //Assert Assert.Equal(expected: expected.HasError, actual: actual.HasError); Assert.Equal(expected: expected.Message, actual: actual.Message); Assert.Equal(expected: expected.CurrentCarrier, actual: actual.CurrentCarrier); }
public void Disconnect_NoInput_CarouselShouldDisconnected() { _carousel = new CarWhiteIpcDualAccess(controlType: ControllerType.WhiteIPCDualAccess, ipAddr: _carouselData.Attribute.IPAddress, carAddr: _carouselData.Attribute.DeviceNumber, port: _carouselData.Attribute.Port, timeOut: 10, returnsStatus: true, deviceResponse: _deviceResponse, socket: _socket); _carousel.Connect(); //Assume bool expected = false; //Act _carousel.Disconnect(); bool actual = _carousel.IsConnected; //Assert Assert.Equal(expected: expected, actual: actual); }
public async Task Move_ShelfInfo_CarouselShouldMove() { _carousel = new CarWhiteIpcDualAccess(controlType: ControllerType.WhiteIPCDualAccess, ipAddr: _carouselData.Attribute.IPAddress, carAddr: _carouselData.Attribute.DeviceNumber, port: _carouselData.Attribute.Port, timeOut: 10, returnsStatus: true, deviceResponse: _deviceResponse, socket: _socket); _carousel.Connect(); //Assume IDeviceResponse expected = new DeviceResponse() { HasError = false, Message = "Data is written on device successfully.", CurrentCarrier = 0 }; //Act IDeviceResponse actual = await _carousel.Move(shelfNum : _carouselData.StorageSpaces.FirstOrDefault(space => space.ItemType.Equals("2")).Number); _carousel.Disconnect(); //Assert Assert.Equal(expected: expected.HasError, actual: actual.HasError); Assert.Equal(expected: expected.Message, actual: actual.Message); Assert.Equal(expected: expected.CurrentCarrier, actual: actual.CurrentCarrier); }