コード例 #1
0
        public void ToStringShouldReturnCaret()
        {
            // Arrange
            var target = new StartOfLineNode();

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

            // Assert
            result.ShouldBe("^");
        }
コード例 #2
0
        public void ToStringOnStartOfLineNodeWithPrefixShouldReturnCommentBeforeCaret()
        {
            // Arrange
            var comment = new CommentGroupNode("This is a comment.");
            var target  = new StartOfLineNode()
            {
                Prefix = comment
            };

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

            // Assert
            result.ShouldBe("(?#This is a comment.)^");
        }