System.Drawing.Tests.FontTests.ToLogFont_Invoke_ReturnsExpected C# (CSharp) Method

ToLogFont_Invoke_ReturnsExpected() private method

private ToLogFont_Invoke_ReturnsExpected ( FontStyle fontStyle, byte gdiCharSet, bool gdiVerticalFont, string expectedNamePrefix, int expectedWeight ) : void
fontStyle FontStyle
gdiCharSet byte
gdiVerticalFont bool
expectedNamePrefix string
expectedWeight int
return void
        public void ToLogFont_Invoke_ReturnsExpected(FontStyle fontStyle, byte gdiCharSet, bool gdiVerticalFont, string expectedNamePrefix, int expectedWeight)
        {
            using (FontFamily family = FontFamily.GenericMonospace)
            using (var font = new Font(family, 10, fontStyle, GraphicsUnit.Point, gdiCharSet, gdiVerticalFont))
            {
                var logFont = new LOGFONT();
                font.ToLogFont(logFont);

                Assert.Equal(-13, logFont.lfHeight);
                Assert.Equal(0, logFont.lfWidth);
                Assert.Equal(0, logFont.lfEscapement);
                Assert.Equal(0, logFont.lfOrientation);
                Assert.Equal(expectedWeight, logFont.lfWeight);
                Assert.Equal(font.Italic ? 1 : 0, logFont.lfItalic);
                Assert.Equal(font.Underline ? 1 : 0, logFont.lfUnderline);
                Assert.Equal(font.Strikeout ? 1 : 0, logFont.lfStrikeOut);
                Assert.Equal(font.GdiCharSet, logFont.lfCharSet);
                Assert.Equal(0, logFont.lfOutPrecision);
                Assert.Equal(0, logFont.lfClipPrecision);
                Assert.Equal(0, logFont.lfQuality);
                Assert.Equal(0, logFont.lfPitchAndFamily);
                Assert.Equal($"{expectedNamePrefix}{family.Name}", logFont.lfFaceName);
            }
        }
FontTests