public void WhenFontFamilyIsWrong_ThenNextSmallerFontThrowsArgumentException() { using (var font = new Font(FontFamily.GenericSerif, 10f, FontStyle.Regular)) { Assert.Throws <ArgumentException>( () => TerminalFont.NextSmallerFont(font)); } }
public void WhenFontFamilyIsOk_ThenNextSmallerFontThrowsArgumentException() { using (var font = new Font(TerminalFont.FontFamily, 10f, FontStyle.Regular)) { using (var smallerFont = TerminalFont.NextSmallerFont(font)) { Assert.AreEqual(smallerFont.Size, font.Size - 1); } } }
public void NextSmallerFontReturnsSmallerFont() { using (var font = new TerminalFont(TerminalFont.DefaultFontFamily, 10f)) { using (var smallerFont = font.NextSmallerFont()) { Assert.AreEqual(font.Font.Size - 1, smallerFont.Font.Size); } } }
public void WhenMinSizeReached_NextSmallerFontKeepsSize() { var font = new TerminalFont(TerminalFont.DefaultFontFamily, 10f); for (int i = 0; i < 10; i++) { font = font.NextSmallerFont(); } Assert.AreEqual(TerminalFont.MinimumSize, font.Font.Size); }