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 TestBoldFlag()
        {
            FontCharacteristics fontCharacteristics = new FontCharacteristics();

            NUnit.Framework.Assert.IsFalse(fontCharacteristics.IsBold());
            NUnit.Framework.Assert.IsTrue(fontCharacteristics.IsUndefined());
            fontCharacteristics.SetBoldFlag(true);
            NUnit.Framework.Assert.IsTrue(fontCharacteristics.IsBold());
            NUnit.Framework.Assert.IsFalse(fontCharacteristics.IsUndefined());
            fontCharacteristics = new FontCharacteristics();
            fontCharacteristics.SetBoldFlag(false);
            NUnit.Framework.Assert.IsFalse(fontCharacteristics.IsBold());
            NUnit.Framework.Assert.IsTrue(fontCharacteristics.IsUndefined());
        }
Ejemplo n.º 3
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.º 4
0
        public virtual void TestIncorrectFontStyle()
        {
            FontCharacteristics fontCharacteristics = new FontCharacteristics();

            fontCharacteristics.SetFontStyle(null);
            NUnit.Framework.Assert.IsFalse(fontCharacteristics.IsItalic());
            NUnit.Framework.Assert.IsTrue(fontCharacteristics.IsUndefined());
            fontCharacteristics.SetFontStyle("dsodkodkopsdkod");
            NUnit.Framework.Assert.IsFalse(fontCharacteristics.IsItalic());
            NUnit.Framework.Assert.IsTrue(fontCharacteristics.IsUndefined());
            fontCharacteristics.SetFontStyle("");
            NUnit.Framework.Assert.IsFalse(fontCharacteristics.IsItalic());
            NUnit.Framework.Assert.IsTrue(fontCharacteristics.IsUndefined());
            fontCharacteristics.SetFontStyle("-1");
            NUnit.Framework.Assert.IsFalse(fontCharacteristics.IsItalic());
            NUnit.Framework.Assert.IsTrue(fontCharacteristics.IsUndefined());
            fontCharacteristics.SetFontStyle("bold");
            NUnit.Framework.Assert.IsFalse(fontCharacteristics.IsItalic());
            NUnit.Framework.Assert.IsTrue(fontCharacteristics.IsUndefined());
        }
Ejemplo n.º 5
0
        public virtual void TestAllowedFontStyle()
        {
            FontCharacteristics fontCharacteristics = new FontCharacteristics();

            NUnit.Framework.Assert.IsFalse(fontCharacteristics.IsItalic());
            NUnit.Framework.Assert.IsTrue(fontCharacteristics.IsUndefined());
            fontCharacteristics = new FontCharacteristics();
            fontCharacteristics.SetFontStyle("normal");
            NUnit.Framework.Assert.IsFalse(fontCharacteristics.IsItalic());
            NUnit.Framework.Assert.IsTrue(fontCharacteristics.IsUndefined());
            fontCharacteristics = new FontCharacteristics();
            fontCharacteristics.SetFontStyle("oblique");
            NUnit.Framework.Assert.IsTrue(fontCharacteristics.IsItalic());
            NUnit.Framework.Assert.IsFalse(fontCharacteristics.IsUndefined());
            fontCharacteristics = new FontCharacteristics();
            fontCharacteristics.SetFontStyle("italic");
            NUnit.Framework.Assert.IsTrue(fontCharacteristics.IsItalic());
            NUnit.Framework.Assert.IsFalse(fontCharacteristics.IsUndefined());
        }
Ejemplo n.º 6
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());
        }