public static void Keyword_GivenValidColorNameEnum_ReturnsNewObject() { FabulousText text = string.Empty; var result = Fabulous.Keyword(ColorKeyword.DarkSeaGreen); Assert.AreNotSame(text, result); }
public static void Keyword_GivenValidColorNameEnum_ReturnsObjectWithForegroundSet() { var expectedColor = new Rgb(143, 188, 143); var result = Fabulous.Keyword(ColorKeyword.DarkSeaGreen); Assert.AreEqual(expectedColor, result.ForegroundColor); }
public static void Keyword_GivenValidColorName_ReturnsObjectWithForegroundSet() { var expectedColor = new Rgb(143, 188, 143); var text = Fabulous.Keyword("DarkSeaGreen"); Assert.AreEqual(expectedColor, text.ForegroundColor); }
public static void Keyword_GivenNullEmptyOrWhiteSpace_ThrowsArgNullException() { Assert.Multiple(() => { Assert.Throws <ArgumentNullException>(() => Fabulous.Keyword(null)); Assert.Throws <ArgumentNullException>(() => Fabulous.Keyword(string.Empty)); Assert.Throws <ArgumentNullException>(() => Fabulous.Keyword(" ")); }); }
public static void Keyword_GivenInvalidKeywordEnum_ThrowsArgNullException() { const ColorKeyword keyword = (ColorKeyword)293048; Assert.Throws <ArgumentException>(() => Fabulous.Keyword(keyword)); }