Exemple #1
0
        public void ServiceConnectorDeviceSendComandGetResponseTest()
        {
            // arrange
            IServiceConnector serviceConnector = ServiceConnector.GetInstance();

            serviceConnector.SetAddress("http://localhost:5000/");
            serviceConnector.DeviceGet(1L);
            const long id       = 1L;
            const long value    = 456L;
            string     sendText = "Hello";

            // act
            var result         = serviceConnector.DeviceSendCommand(id, value, sendText);
            var resultResponse = serviceConnector.DeviceGet(id);

            // assert
            Assert.IsTrue(result);
            Assert.AreEqual(sendText, resultResponse.Text);
            Assert.AreEqual(value, resultResponse.Value);
        }