Example #1
0
        public async Task Move_SlotInfo_CarouselShouldMove()
        {
            IUtility utility = new Utility();

            _carousel = new CarWhiteTB1470(controlType: ControllerType.WhiteTB1470, 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);
        }
Example #2
0
        public void Disconnect_NoInput_CarouselShouldDisconnected()
        {
            _carousel = new CarWhiteTB1470(controlType: ControllerType.WhiteTB1470, 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);
        }