public async Task When_Moisture_Remains_Above_Min_Then_Should_Not_Send_Irrigate_Command() { GivenTheMoistureMinIs(10); var telemetry = MoistureTelemetry.Create(DeviceId, SensorId, 11); await Handler.HandleAsync(telemetry); CommandService.DidNotReceive().RaiseAsync(Arg.Any <IrrigateCommand>()); }
public async Task When_Moisture_Drops_Below_Min_Then_Should_Send_Irrigate_Command() { GivenTheMoistureMinIs(10); GivenTheIrrigationDurationIs(TimeSpan.FromMinutes(5)); var telemetry = MoistureTelemetry.Create(DeviceId, SensorId, 10); await Handler.HandleAsync(telemetry); var command = (IrrigateCommand)_capturedCommand; command.DeviceId.Should().Be(DeviceId); command.SensorId.Should().Be(SensorId); command.Duration.Should().Be(300000); }