Beispiel #1
0
        public void ShouldKeepSensor_WhenAllValuesWithinOnePercentOfReference()
        {
            var sensor = new HumiditySensor("myHumiditySensor", 50m);

            sensor.AddReading("50.1");
            sensor.AddReading("49.2");
            Assert.That(sensor.GetStatus(), Is.EqualTo("keep"));
        }
Beispiel #2
0
        public void ShouldDiscardSensor_WhenAnyReadingGreaterThanOrEqualToOne()
        {
            var sensor = new HumiditySensor("myHumiditySensor", 50m);

            sensor.AddReading("50.1");
            sensor.AddReading("49.2");
            sensor.AddReading("49");
            Assert.That(sensor.GetStatus(), Is.EqualTo("discard"));
        }