Ejemplo n.º 1
0
        public void TestTriStateBooleanProperty_Apply()
        {
            CharacterProperties cp = new CharacterProperties();

            CharacterProperties cpBold = new CharacterProperties();
            cpBold.Bold = true;
            cp.Apply(cpBold);
            Assert.IsFalse(cp.Bold.IsDefault());
            Assert.IsTrue(cp.Bold);

            CharacterProperties cpUnbold = new CharacterProperties();
            cpUnbold.Bold = false;
            cp.Apply(cpUnbold);
            Assert.IsFalse(cp.Bold.IsDefault());
            Assert.IsFalse(cp.Bold);
        }
Ejemplo n.º 2
0
        public void TestTriStateShortProperty_Apply()
        {
            CharacterProperties cp = new CharacterProperties();
            cp.SubscriptPosition = 4;

            CharacterProperties cpHigher = new CharacterProperties();
            cp.SubscriptPosition = 6;
            cp.Apply(cpHigher);
            Assert.IsFalse(cp.SubscriptPosition.IsDefault());
            Assert.AreEqual(6, cp.SubscriptPosition);

            CharacterProperties cpLower = new CharacterProperties();
            cpLower.SubscriptPosition = 2;
            cp.Apply(cpLower);
            Assert.IsFalse(cp.SubscriptPosition.IsDefault());
            Assert.AreEqual(2, cp.SubscriptPosition);
        }
Ejemplo n.º 3
0
        public void TestTriStateStringProperty_Apply()
        {
            CharacterProperties cp = new CharacterProperties();

            CharacterProperties cpRed = new CharacterProperties();
            cpRed.FontHighlight = "FF0000";
            cp.Apply(cpRed);
            Assert.AreEqual("FF0000", cp.FontHighlight);

            CharacterProperties cpGreen = new CharacterProperties();
            cpGreen.FontHighlight = "00FF00";
            cp.Apply(cpGreen);
            Assert.AreEqual("00FF00", cp.FontHighlight);

            CharacterProperties cpDefault = new CharacterProperties();
            cpDefault.FontHighlight = null;
            cp.Apply(cpDefault);
            Assert.AreEqual("00FF00", cp.FontHighlight);

            CharacterProperties cpNoColor = new CharacterProperties();
            cpNoColor.FontHighlight = string.Empty;
            cp.Apply(cpNoColor);
            Assert.AreEqual(string.Empty, cp.FontHighlight);
        }