Exemple #1
0
        public void GetLamps_GivenTrafficLightID_ReturnsLamps()
        {
            var greenLamp = new Lamp(1, LampColor.Green);
            var redLamp   = new Lamp(0, LampColor.Red);
            var lamps     = new[] { greenLamp, redLamp };

            var trafficLight = new TrafficLight(0, lamps);

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

            var actualLamps = trafficLightController.GetLamps(0);

            Assert.Equal(lamps, actualLamps);
        }