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

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

            // Act
            await miioGateway.SetArmingOffAsync();

            // Assert
            miioDevice.Verify(x => x.SendMessageAsync("{\"id\": 1, \"method\": \"set_arming\", \"params\": [\"off\"]}"), Times.Once());
        }