Ejemplo n.º 1
0
        public void AppendTsString_EmptyBldrOneRunString_AppendsText()
        {
            var tisb = new TsIncStrBldr();

            tisb.AppendTsString(new TsString("text", EnglishWS));
            Assert.That(tisb.Text, Is.EqualTo("text"));
            Assert.That(tisb.Runs.Count, Is.EqualTo(1));
            Assert.That(GetWS(tisb, 0), Is.EqualTo(EnglishWS));
        }
Ejemplo n.º 2
0
        public void AppendTsString_OneRunBldrOneRunStringSameProperties_AppendsText()
        {
            TsIncStrBldr tisb = CreateOneRunBldr();

            tisb.AppendTsString(new TsString("text", EnglishWS));
            Assert.That(tisb.Text, Is.EqualTo(EnglishText + "text"));
            Assert.That(tisb.Runs.Count, Is.EqualTo(1));
            Assert.That(GetWS(tisb, 0), Is.EqualTo(EnglishWS));
        }
Ejemplo n.º 3
0
        public void AppendTsString_EmptyBldrEmptyString_UpdatesProperties()
        {
            var tisb = new TsIncStrBldr();

            tisb.AppendTsString(new TsString(EnglishWS));
            Assert.That(tisb.Text, Is.Null);
            Assert.That(tisb.Runs.Count, Is.EqualTo(0));
            int var;

            Assert.That(tisb.PropsBldr.GetIntPropValues((int)FwTextPropType.ktptWs, out var), Is.EqualTo(EnglishWS));
        }
Ejemplo n.º 4
0
        public void AppendTsString_OneRunBldrOneRunStringDifferentProperties_AppendsText()
        {
            TsIncStrBldr tisb = CreateOneRunBldr();

            tisb.AppendTsString(new TsString("text", SpanishWS));
            Assert.That(tisb.Text, Is.EqualTo(EnglishText + "text"));
            Assert.That(tisb.Runs.Count, Is.EqualTo(2));
            Assert.That(GetWS(tisb, 0), Is.EqualTo(EnglishWS));
            Assert.That(GetWS(tisb, 1), Is.EqualTo(SpanishWS));
            Assert.That(tisb.Runs[0].IchLim, Is.EqualTo(EnglishText.Length));
            Assert.That(tisb.Runs[1].IchLim, Is.EqualTo(tisb.Text.Length));
            int var;

            Assert.That(tisb.PropsBldr.GetIntPropValues((int)FwTextPropType.ktptWs, out var), Is.EqualTo(SpanishWS));
        }
Ejemplo n.º 5
0
        public void AppendTsString_NullString_Throws()
        {
            TsIncStrBldr tisb = CreateOneRunBldr();

            Assert.That(() => tisb.AppendTsString(null), Throws.InstanceOf <ArgumentNullException>());
        }