Пример #1
0
        public void GetArmingOffTime_Returns_Integer()
        {
            // Arrange
            var miioDevice = new Mock <IMiioTransport>();

            miioDevice.Setup(x => x.SendMessage(It.IsAny <string>())).Returns("{\"result\":[15],\"id\":1}");
            var miioGateway = new MiioGateway(miioDevice.Object);

            // Act
            var armingOffTime = miioGateway.GetArmingOffTime();

            // Assert
            miioDevice.Verify(x => x.SendMessage("{\"id\": 1, \"method\": \"get_device_prop\", \"params\": [\"lumi.0\",\"alarm_time_len\"]}"), Times.Once());
            Assert.Equal(15, armingOffTime);
        }