public void InitialCounts()
        {
            var chunk = ExposingTestChunk.Create("  Test this    \n", styleSystem);

            chunk.TrimStart.Should().Be(2);
            chunk.TrimEnd.Should().Be(5);
            chunk.TrimLineBreaks.Should().Be(1);
        }
Beispiel #2
0
        public static ExposingTestChunk Create(string text, IStyleSystem styleSystem)
        {
            var length = text.Length;

            var node = Substitute.For <ITextNode>();

            node.Document.TextAt(Arg.Any <int>(), Arg.Any <int>()).Returns(text);
            var startPos = Substitute.For <ITextPosition>();

            startPos.Offset.Returns(0);

            var endPos = Substitute.For <ITextPosition>();

            endPos.Offset.Returns(length);

            var chunk = new ExposingTestChunk(new TextProcessingRules(), node, LayoutTestStyle.CreateTextStyle(styleSystem), startPos, endPos);

            chunk.Initialize();
            return(chunk);
        }