public async Task Move_SlotInfo_CarouselShouldMove() { IUtility utility = new Utility(); _carousel = new CarWhiteTB1470H(controlType: ControllerType.WhiteTB1470H, 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)); _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 CarWhiteTB1470H(controlType: ControllerType.WhiteTB1470H, 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); }