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); }
public static FontStyle ToFontStyle(this FontInfoStyle s) => (FontStyle)(int)s;
public static XFontStyle ToXFontStyle(this FontInfoStyle s) => (XFontStyle)(int)s;
public FontInfo(string family, float size, FontInfoStyle style = FontInfoStyle.Regular) { Family = family; Size = size; Style = style; }
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); }