Ejemplo n.º 1
0
        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());
        }
Ejemplo n.º 2
0
        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());
        }
Ejemplo n.º 3
0
        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());
        }