public AutoCorrectionContext(TextRange range) { myRange = range; myLines = new Lazy <IReadOnlyCollection <TextRange> >(() => DocumentOperations.GetLines(range)); myWords = new Lazy <IReadOnlyCollection <TextRange> >(() => DocumentOperations.GetWords(range)); }
public void GetLines_When_ReturnsAllLinesOfARange() { var lines = DocumentOperations.GetLines(new TextRange(myDocument.ContentStart, myDocument.ContentEnd)) .Select(l => l.Text) .ToList(); var expected = new[] { "Here is some text to test parsing", "a second line would be helpful.", string.Empty, "A third is even better." }; Assert.That(lines, Is.EquivalentTo(expected)); }