Exemplo n.º 1
0
        public void SetStrPropValue_OneRunBldrFullRange_UpdatesProperties()
        {
            TsStrBldr tsb = CreateOneRunBldr();

            Assert.That(GetFont(tsb, 0), Is.EqualTo(Font1));
            tsb.SetStrPropValue(0, tsb.Length, (int)FwTextPropType.ktptFontFamily, Font2);
            Assert.That(GetFont(tsb, 0), Is.EqualTo(Font2));
        }
Exemplo n.º 2
0
        public void SetStrPropValue_OneRunBldrEmptyRange_DoesNotUpdateProperties()
        {
            TsStrBldr tsb = CreateOneRunBldr();

            Assert.That(GetFont(tsb, 0), Is.EqualTo(Font1));
            tsb.SetStrPropValue(0, 0, (int)FwTextPropType.ktptFontFamily, Font2);
            Assert.That(GetFont(tsb, 0), Is.EqualTo(Font1));
        }
Exemplo n.º 3
0
        public void SetStrPropValue_EmptyBldr_UpdatesProperties()
        {
            TsStrBldr tsb = CreateEmptyBldr();

            Assert.That(GetFont(tsb, 0), Is.Null);
            tsb.SetStrPropValue(0, 0, (int)FwTextPropType.ktptFontFamily, Font1);
            Assert.That(GetFont(tsb, 0), Is.EqualTo(Font1));
        }
Exemplo n.º 4
0
        public void SetStrPropValue_TwoRunBldrRangeReplacesFirstOverlapsSecond_UpdatesProperties()
        {
            TsStrBldr tsb = CreateMixedFontBldr();

            tsb.SetStrPropValue(0, 27, (int)FwTextPropType.ktptFontFamily, Font3);
            Assert.That(tsb.RunCount, Is.EqualTo(2));
            Assert.That(tsb.get_RunText(0), Is.EqualTo("This is a test! How are you"));
            Assert.That(GetFont(tsb, 0), Is.EqualTo(Font3));
            int ichMin, ichLim;

            tsb.GetBoundsOfRun(0, out ichMin, out ichLim);
            Assert.That(ichMin, Is.EqualTo(0));
            Assert.That(ichLim, Is.EqualTo(27));
            tsb.GetBoundsOfRun(1, out ichMin, out ichLim);
            Assert.That(ichMin, Is.EqualTo(27));
            Assert.That(ichLim, Is.EqualTo(tsb.Length));
        }
Exemplo n.º 5
0
        public void SetStrPropValue_TwoRunBldrRangeOverlapsBothSamePropertiesAsLast_UpdatesProperties()
        {
            TsStrBldr tsb = CreateMixedFontBldr();

            tsb.SetStrPropValue(6, 27, (int)FwTextPropType.ktptFontFamily, Font2);
            Assert.That(tsb.RunCount, Is.EqualTo(2));
            Assert.That(tsb.get_RunText(1), Is.EqualTo("s a test! How are you today?"));
            Assert.That(GetFont(tsb, 1), Is.EqualTo(Font2));
            int ichMin, ichLim;

            tsb.GetBoundsOfRun(0, out ichMin, out ichLim);
            Assert.That(ichMin, Is.EqualTo(0));
            Assert.That(ichLim, Is.EqualTo(6));
            tsb.GetBoundsOfRun(1, out ichMin, out ichLim);
            Assert.That(ichMin, Is.EqualTo(6));
            Assert.That(ichLim, Is.EqualTo(tsb.Length));
        }
Exemplo n.º 6
0
        public void SetStrPropValue_IchMinGreaterThanIchLim_Throws()
        {
            TsStrBldr tsb = CreateMixedWSBldr();

            Assert.That(() => tsb.SetStrPropValue(25, 24, (int)FwTextPropType.ktptFontFamily, Font1), Throws.InstanceOf <ArgumentOutOfRangeException>());
        }