Example #1
0
        public void It_should_properly_convert_style(FontInfoStyle style)
        {
            var name = Enum.GetName(typeof(FontInfoStyle), style);

            Enum.TryParse <XFontStyle>(name, true, out var expected).ShouldBe(true);
            style.ToXFontStyle().ShouldBe(expected);
        }
Example #2
0
 public static FontStyle ToFontStyle(this FontInfoStyle s) => (FontStyle)(int)s;
Example #3
0
 public static XFontStyle ToXFontStyle(this FontInfoStyle s) => (XFontStyle)(int)s;
Example #4
0
 public FontInfo(string family, float size, FontInfoStyle style = FontInfoStyle.Regular)
 {
     Family = family;
     Size   = size;
     Style  = style;
 }
Example #5
0
        public void It_should_parse_font(string font, string expectedFamily, float expectedSize, FontInfoStyle expectedStyle)
        {
            var f = FontInfo.Parse(font);

            f.ShouldNotBeNull();
            f.Family.ShouldBe(expectedFamily);
            f.Size.ShouldBe(expectedSize);
            f.Style.ShouldBe(expectedStyle);
        }