public void TestEmpty() { SourceText st = SourceText.Empty; Assert.That(st.Text, Is.EqualTo(string.Empty)); Assert.That(st.Length, Is.EqualTo(0)); Assert.That(st.FileInfo, Is.Null); Assert.That(st.TextLines.Count, Is.EqualTo(1)); var tl = st.GetTextLineAtPosition(0); Assert.That(tl.ToString(), Is.EqualTo(string.Empty)); }
public void TestSingleLine() { const string testText = "hello There!"; SourceText st = SourceText.From(testText); Assert.That(st.Text, Is.EqualTo(testText)); Assert.That(st.Length, Is.EqualTo(testText.Length)); Assert.That(st.FileInfo, Is.Null); Assert.That(st.TextLines.Count, Is.EqualTo(1)); var tl = st.GetTextLineAtPosition(0); Assert.That(tl.ToString(), Is.EqualTo(testText)); Assert.That(tl.Span.ToString(), Is.EqualTo(testText)); }