Exemple #1
0
        public async Task SetStateEntityCallsCorrectServiceCall()
        {
            // ARRANGE
            // ACT
            await DefaultDaemonApp
            .Entity("light.correct_entity")
            .SetState(50)
            .ExecuteAsync();

            // ASSERT
            DefaultHassClientMock.VerifySetStateTimes("light.correct_entity", Times.Once());
            DefaultHassClientMock.VerifySetState("light.correct_entity", "50");
        }
Exemple #2
0
        public async Task SetStateWithAttributesEntityCallsCorrectServiceCall()
        {
            // ARRANGE
            // ACT
            await DefaultDaemonHost
            .Entity("light.correct_entity")
            .SetState(50)
            .WithAttribute("attr1", "str_value")
            .ExecuteAsync();

            // ASSERT
            DefaultHassClientMock.VerifySetStateTimes("light.correct_entity", Times.Once());
            DefaultHassClientMock.VerifySetState("light.correct_entity", "50", ("attr1", "str_value"));
        }