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

ToHfont_Disposed_ThrowsArgumentException() private method

private ToHfont_Disposed_ThrowsArgumentException ( ) : void
return void
        public void ToHfont_Disposed_ThrowsArgumentException()
        {
            using (FontFamily family = FontFamily.GenericSansSerif)
            using (var image = new Bitmap(10, 10))
            using (Graphics graphics = Graphics.FromImage(image))
            {
                var font = new Font(family, 10);
                font.Dispose();

                AssertExtensions.Throws<ArgumentException>(null, () => font.ToHfont());
            }
        }
FontTests