Esempio n. 1
0
        public void GetArmingLastTimeTriggeredTimestamp_Returns_Integer()
        {
            // Arrange
            var miioDevice = new Mock <IMiioTransport>();

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

            // Act
            var timestamp = miioGateway.GetArmingLastTimeTriggeredTimestamp();

            // Assert
            miioDevice.Verify(x => x.SendMessage("{\"id\": 1, \"method\": \"get_arming_time\", \"params\": []}"), Times.Once());
            Assert.Equal(1609150074, timestamp);
        }