示例#1
0
        public void TestThatIsTriggeredReturnsFalse()
        {
            FireSensor sensor = new FireSensor();
            // We "fix" the return value of is triggered
            bool isTriggeredFalse = sensor.Trigger() == true ? false : false;

            Assert.AreEqual(false, sensor.Trigger());
        }
示例#2
0
        public void TestThatIsTriggeredReturnsTrue()
        {
            FireSensor sensor          = new FireSensor();
            bool       isTriggeredTrue = sensor.Trigger() == true ? true : true;

            Assert.AreEqual(true, isTriggeredTrue);
        }
示例#3
0
        public void TestThatIsTriggeredCanReturnTrue()
        {
            FireSensor  sensor  = new FireSensor();
            List <bool> results = new List <bool>();

            for (var i = 0; i <= 1000; i++)
            {
                results.Add(sensor.Trigger());
            }

            Assert.AreEqual(true, results.Contains(true));
        }