コード例 #1
0
        public void ToStringShouldReturnBackslashGroupNumber()
        {
            // Arrange
            var target = new BackreferenceNode(5);

            // Act
            var result = target.ToString();

            // Assert
            result.ShouldBe(@"\5");
        }
コード例 #2
0
        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");
        }