public void ExtractParameterOrderDoesNotMatter(int insertionIndex) { var caret = Content.CursorFromGraphemeIndex(insertionIndex); var originalText = Content.AsText(); var content = new TextBlockContent(); content.Insert(content.GetCaretAtStart(), "ABCDEFGHIJ"); var newPosition = Content.Insert(caret, content); // make sure the inserted text is correct by comparing the text we get by simply inserted the // same text into a string. var expectedFinalText = originalText.Insert(insertionIndex, content.AsText()); DidYouKnow.That(Content.AsText()).Should().Be(expectedFinalText); // make sure the caret returned is correct by comparing it to the text that should come after // the caret. var expectedAfterText = originalText.Substring(0, insertionIndex) + "ABCDEFGHIJ"; DidYouKnow.That(Content.CloneContent(Content.GetCaretAtStart(), newPosition).AsText()) .Should().Be(expectedAfterText); }
private static TextBlockContent CreateContent(string text) { var content = new TextBlockContent(); content.Insert(content.GetCaretAtStart(), text); return(content); }
public TextBlockContentTests() { Content = new TextBlockContent(); Content.Insert(Content.GetCaretAtStart(), "123456789"); }