public virtual void TestIncorrectFontWeight() { FontCharacteristics fontCharacteristics = new FontCharacteristics(); fontCharacteristics.SetFontWeight((short)0); NUnit.Framework.Assert.AreEqual(400, fontCharacteristics.GetFontWeight()); NUnit.Framework.Assert.IsTrue(fontCharacteristics.IsUndefined()); fontCharacteristics.SetFontWeight((short)-500); NUnit.Framework.Assert.AreEqual(400, fontCharacteristics.GetFontWeight()); NUnit.Framework.Assert.IsTrue(fontCharacteristics.IsUndefined()); }
public virtual void TestDefaultFontCharacteristics() { FontCharacteristics fontCharacteristics = new FontCharacteristics(); NUnit.Framework.Assert.IsFalse(fontCharacteristics.IsItalic()); NUnit.Framework.Assert.IsFalse(fontCharacteristics.IsBold()); NUnit.Framework.Assert.IsFalse(fontCharacteristics.IsMonospace()); NUnit.Framework.Assert.IsTrue(fontCharacteristics.IsUndefined()); NUnit.Framework.Assert.AreEqual(400, fontCharacteristics.GetFontWeight()); }
public virtual void TestPositiveFontWeight() { FontCharacteristics fontCharacteristics = new FontCharacteristics(); fontCharacteristics.SetFontWeight((short)50); NUnit.Framework.Assert.AreEqual(100, fontCharacteristics.GetFontWeight()); NUnit.Framework.Assert.IsFalse(fontCharacteristics.IsUndefined()); fontCharacteristics.SetFontWeight((short)120); NUnit.Framework.Assert.AreEqual(100, fontCharacteristics.GetFontWeight()); NUnit.Framework.Assert.IsFalse(fontCharacteristics.IsUndefined()); fontCharacteristics.SetFontWeight((short)340); NUnit.Framework.Assert.AreEqual(300, fontCharacteristics.GetFontWeight()); NUnit.Framework.Assert.IsFalse(fontCharacteristics.IsUndefined()); fontCharacteristics.SetFontWeight((short)550); NUnit.Framework.Assert.AreEqual(500, fontCharacteristics.GetFontWeight()); NUnit.Framework.Assert.IsFalse(fontCharacteristics.IsUndefined()); fontCharacteristics.SetFontWeight((short)885); NUnit.Framework.Assert.AreEqual(800, fontCharacteristics.GetFontWeight()); NUnit.Framework.Assert.IsFalse(fontCharacteristics.IsUndefined()); fontCharacteristics.SetFontWeight((short)20000); NUnit.Framework.Assert.AreEqual(900, fontCharacteristics.GetFontWeight()); NUnit.Framework.Assert.IsFalse(fontCharacteristics.IsUndefined()); }