示例#1
0
        public void Append_EmptyBldrNullString_DoesNotAppendText()
        {
            var tisb = new TsIncStrBldr();

            tisb.Append(null);
            Assert.That(tisb.Text, Is.Null);
            Assert.That(tisb.Runs.Count, Is.EqualTo(0));
        }
示例#2
0
        public void Append_EmptyBldrNonEmptyString_AppendsText()
        {
            var tisb = new TsIncStrBldr();

            tisb.Append("text");
            Assert.That(tisb.Text, Is.EqualTo("text"));
            Assert.That(tisb.Runs.Count, Is.EqualTo(1));
        }
示例#3
0
        public void Append_OneRunBldrNonEmptyString_AppendsText()
        {
            TsIncStrBldr tisb = CreateOneRunBldr();

            tisb.Append("text");
            Assert.That(tisb.Text, Is.EqualTo(EnglishText + "text"));
            Assert.That(tisb.Runs.Count, Is.EqualTo(1));
            Assert.That(GetWS(tisb, 0), Is.EqualTo(EnglishWS));
        }
示例#4
0
        public void Append_EmptyBldrPropSetNonEmptyString_AppendsText()
        {
            var tisb = new TsIncStrBldr();

            tisb.SetIntPropValues((int)FwTextPropType.ktptWs, (int)FwTextPropVar.ktpvDefault, 1);
            tisb.Append("text");
            Assert.That(tisb.Text, Is.EqualTo("text"));
            Assert.That(tisb.Runs.Count, Is.EqualTo(1));
            Assert.That(GetWS(tisb, 0), Is.EqualTo(EnglishWS));
        }
示例#5
0
        public void Append_OneRunBldrPropSetNonEmptyString_AppendsText()
        {
            TsIncStrBldr tisb = CreateOneRunBldr();

            tisb.SetIntPropValues((int)FwTextPropType.ktptWs, (int)FwTextPropVar.ktpvDefault, SpanishWS);
            tisb.Append("text");
            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));
        }