Beispiel #1
0
        public async Task GivenLamp_PutIntoDifferentState_SetsLampStateToNewState(bool newLampState)
        {
            var greenLamp = new Lamp(1, LampColor.Green);

            greenLamp.SetLampState(!newLampState);
            var trafficLight = new TrafficLight(0, new[] { greenLamp });

            Mock.Get(trafficLightRepo).Setup(x => x.GetTrafficLightById(0)).Returns(trafficLight);

            await trafficLightController.Put(0, 1, newLampState);

            Assert.Equal(newLampState, greenLamp.IsOn);
        }