public void ToStringShouldReturnBackslashGroupNumber() { // Arrange var target = new BackreferenceNode(5); // Act var result = target.ToString(); // Assert result.ShouldBe(@"\5"); }
public void ToStringOnBackreferenceNodeWithPrefixShouldReturnPrefixBeforeBackreference() { // Arrange var comment = new CommentGroupNode("This is a comment."); var target = new BackreferenceNode(5) { Prefix = comment }; // Act var result = target.ToString(); // Assert result.ShouldBe(@"(?#This is a comment.)\5"); }