public virtual StringBuilder Represent(NumberingContainer text, ILanguage language)
 {
     return(representContainer(
                text,
                language,
                (lineNumber, lineCount) => $" {lineNumber.ToString().PadLeft(lineCount.ToString().Length, ' ')}. "));
 }
Exemplo n.º 2
0
        public void CreateEmptyNumberingContainer()
        {
            // act
            var container = new NumberingContainer();

            // assert
            Assert.AreEqual(0, container.Items.Count);
        }
Exemplo n.º 3
0
 public virtual StringBuilder Represent(NumberingContainer text, ILanguage language)
 {
     return(representContainer(
                text,
                language,
                "<ol>",
                "</ol>",
                "<li>",
                "</li>"));
 }
Exemplo n.º 4
0
        public void CreateOneItemNumberingContainer()
        {
            // arrange
            var item = new SpaceText();

            // act
            var container = new NumberingContainer(item);

            // assert
            Assert.AreSame(item, container.Items.Single());
        }
Exemplo n.º 5
0
        public void CreateManyItemsNumberingContainer()
        {
            // arrange
            var items = new List <IText>
            {
                new SpaceText(),
                new LineBreakText(),
                new FormattedText(language => string.Empty),
            };

            // act
            var container = new NumberingContainer(items);

            // assert
            Assert.IsTrue(items.SequenceEqual(container.Items));
        }