public void NamedReferenceWithUseKFalseToStringShouldReturnBackslashNameBetweenBrackets() { // Arrange var target = new NamedReferenceNode("name", false, false); // Act string result = target.ToString(); // Assert result.ShouldBe(@"\<name>"); }
public void NamedReferenceWithUseQuotesTrueToStringShouldReturnBackslashLowercaseKNameBetweenSingleQuotes() { // Arrange var target = new NamedReferenceNode("name", true); // Act string result = target.ToString(); // Assert result.ShouldBe(@"\k'name'"); }
public void ToStringOnNamedReferenceNodeWithPrefixShouldReturnPrefixBeforeNamedReference() { // Arrange var comment = new CommentGroupNode("This is a comment."); var target = new NamedReferenceNode("name", false) { Prefix = comment }; // Act var result = target.ToString(); // Assert result.ShouldBe(@"(?#This is a comment.)\k<name>"); }