public static void FromKeyword_GivenColorKeywordWithEnum_ReturnsRgbColorDefinition() { var rgb = new Rgb(255, 69, 0); var orangeRed = Rgb.FromKeyword(ColorKeyword.OrangeRed); Assert.AreEqual(rgb, orangeRed); }
public static void FromKeyword_GivenColorKeywordWithDifferentCase_ReturnsRgbColorDefinition() { var rgb = new Rgb(255, 69, 0); var orangeRed = Rgb.FromKeyword("orAnGeRed"); Assert.AreEqual(rgb, orangeRed); }
public static void FromKeyword_GivenValidColorKeyword_ReturnsRgbColorDefinition() { var rgb = new Rgb(255, 69, 0); var orangeRed = Rgb.FromKeyword("orangered"); Assert.AreEqual(rgb, orangeRed); }
public static void FromKeyword_GivenEmptyKeywordString_ThrowsArgNullException() { Assert.Multiple(() => { Assert.Throws <ArgumentNullException>(() => Rgb.FromKeyword(null)); Assert.Throws <ArgumentNullException>(() => Rgb.FromKeyword(string.Empty)); Assert.Throws <ArgumentNullException>(() => Rgb.FromKeyword(" ")); }); }
public static void FromKeyword_GivenColorKeywordWithInvalidEnum_ThrowsArgException() { const ColorKeyword badEnum = (ColorKeyword)293048; Assert.Throws <ArgumentException>(() => Rgb.FromKeyword(badEnum)); }
public static void FromKeyword_GivenUnknownColorKeyword_ThrowsArgOutOfRangeException() { Assert.Throws <ArgumentOutOfRangeException>(() => Rgb.FromKeyword("this_color_does_not_exist")); }