public async Task CameraEnableMotionDetectionCallsCorrectServiceCall() { // ARRANGE var entityId = "camera.camera1"; var service_call = "enable_motion_detection"; // ACT await DefaultDaemonApp .Camera(entityId) .EnableMotionDetection() .ExecuteAsync(); // ASSERT DefaultHassClientMock.VerifyCallServiceTimes(service_call, Times.Once()); DefaultHassClientMock.VerifyCallServiceTuple("camera", service_call, ("entity_id", entityId)); }
public async Task CameraTurnOffCallsCorrectServiceCall() { // ARRANGE var entityId = "camera.camera1"; var service_call = "turn_off"; // ACT await DefaultDaemonApp .Camera(entityId) .TurnOff() .ExecuteAsync(); // ASSERT DefaultHassClientMock.VerifyCallServiceTimes(service_call, Times.Once()); DefaultHassClientMock.VerifyCallServiceTuple("camera", service_call, ("entity_id", entityId)); }
public async Task CamerasFuncDisableMotionDetectionCallsCorrectServiceCall() { // ARRANGE var entityId = "camera.camera1"; var service_call = "disable_motion_detection"; DefaultDaemonHost.InternalState["camera.camera1"] = new EntityState { EntityId = entityId, State = "on" }; // ACT await DefaultDaemonApp .Cameras(n => n.EntityId == entityId) .DisableMotionDetection() .ExecuteAsync(); // ASSERT DefaultHassClientMock.VerifyCallServiceTimes(service_call, Times.Once()); DefaultHassClientMock.VerifyCallServiceTuple("camera", service_call, ("entity_id", entityId)); }