Exemplo n.º 1
0
        public void ShouldTurnOffEngineWhenPressPowerButtonAndEngineIsTurnedOn()
        {
            //Setup
            SetEngineAs(true);

            //Test
            _plc.SetValueByTag("StartButton", false);

            //Assert
            var engineStatus = Convert.ToBoolean(_plc.GetValueByTag("Engine"));

            Assert.False(engineStatus);
        }
        public void ShouldTurnOnEngineOneWhenSensorOneDetectsTheBottle()
        {
            //Setup
            SetEngineAs(false);
            IList <bool> engineStatus = new List <bool>();

            //Test
            _plc.SetValueByTag("Sensor1", true);
            engineStatus.Add(Convert.ToBoolean(_plc.GetValueByTag("Engine1")));
            _plc.SetValueByTag("Sensor1", false);
            engineStatus.Add(Convert.ToBoolean(_plc.GetValueByTag("Engine1")));

            //Assert
            Assert.All(engineStatus, status => Assert.True(status));
        }