public void CanIGo_given_Invalid_Color_throws_with_message_Invalid_Color() { var controller = new TrafficLightController(); var exception = Assert.Throws <ArgumentException>(() => controller.MayIGo("Invalid Color")); Assert.Equal("Invalid color", exception.Message); }
public void CanIGo_given_Green_returns_True() { var controller = new TrafficLightController(); var go = controller.MayIGo("Green"); Assert.True(go); }
public void CanIGo_given_Red_returns_False() { var controller = new TrafficLightController(); var go = controller.MayIGo("RED"); Assert.False(go); }
public void CanIGo_given_color_returns_expected(TrafficLightColor color, bool expected) { var controller = new TrafficLightController(); var go = controller.MayIGo(color); Assert.Equal(expected, go); }
public void CanIGo_given_Yellow_returns_False() { var controller = new TrafficLightController(); var go = controller.MayIGo(TrafficLightColor.Yellow); Assert.False(go); }
public void CanIGo_given_Green_returns_True() { var ctrl = new TrafficLightController(); var go = ctrl.MayIGo(Green); Assert.True(go); }
public void CanIGo_given_Red_returns_False() { var ctrl = new TrafficLightController(); var go = ctrl.MayIGo(Red); Assert.False(go); }
public void MayIGo_given_invalid_color_throws() { var ctrl = new TrafficLightController(); var actual = Assert.Throws <ArgumentException>(() => ctrl.MayIGo((TrafficLightColor)42)); Assert.Equal("Invalid color (Parameter 'color')", actual.Message); }
public void MayIGo_given_color_returns_expected(TrafficLightColor color, bool expected) { var ctrl = new TrafficLightController(); var actual = ctrl.MayIGo(color); Assert.Equal(actual, expected); }
public void CanIGo_given_Invalid_Color_throws_ArgumentException() { var controller = new TrafficLightController(); Assert.Throws <ArgumentException>(() => controller.MayIGo("Invalid Color")); }
public void CanIGo_given_42_throws_ArgumentException() { var controller = new TrafficLightController(); Assert.Throws <ArgumentException>(() => controller.MayIGo((TrafficLightColor)42)); }