示例#1
0
        public static void Keyword_GivenValidColorNameEnum_ReturnsNewObject()
        {
            FabulousText text   = string.Empty;
            var          result = Fabulous.Keyword(ColorKeyword.DarkSeaGreen);

            Assert.AreNotSame(text, result);
        }
示例#2
0
        public static void Keyword_GivenValidColorNameEnum_ReturnsObjectWithForegroundSet()
        {
            var expectedColor = new Rgb(143, 188, 143);
            var result        = Fabulous.Keyword(ColorKeyword.DarkSeaGreen);

            Assert.AreEqual(expectedColor, result.ForegroundColor);
        }
示例#3
0
        public static void Keyword_GivenValidColorName_ReturnsObjectWithForegroundSet()
        {
            var expectedColor = new Rgb(143, 188, 143);

            var text = Fabulous.Keyword("DarkSeaGreen");

            Assert.AreEqual(expectedColor, text.ForegroundColor);
        }
示例#4
0
 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("   "));
     });
 }
示例#5
0
        public static void Keyword_GivenInvalidKeywordEnum_ThrowsArgNullException()
        {
            const ColorKeyword keyword = (ColorKeyword)293048;

            Assert.Throws <ArgumentException>(() => Fabulous.Keyword(keyword));
        }