public void WhenFontFamilyIsWrong_ThenNextLargerFontThrowsArgumentException() { using (var font = new Font(FontFamily.GenericSerif, 10f, FontStyle.Regular)) { Assert.Throws <ArgumentException>( () => TerminalFont.NextLargerFont(font)); } }
public void WhenFontFamilyIsOk_ThenNNextLargerFontThrowsArgumentException() { using (var font = new Font(TerminalFont.FontFamily, 10f, FontStyle.Regular)) { using (var smallerFont = TerminalFont.NextLargerFont(font)) { Assert.AreEqual(smallerFont.Size, font.Size + 1); } } }
public void WhenMaxSizeReached_NextLargerFontKeepsSize() { var font = new TerminalFont(TerminalFont.DefaultFontFamily, 40f); for (int i = 0; i < 10; i++) { font = font.NextLargerFont(); } Assert.AreEqual(TerminalFont.MaximumSize, font.Font.Size); }