Exemple #1
0
        public void ToStringOnEmptyModeModifierGroupNodeShouldReturnModeModifierGroupWithModifiers()
        {
            // Arrange
            var target = new ModeModifierGroupNode("imsnx-imsnx");

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

            // Assert
            result.ShouldBe("(?imsnx-imsnx)");
        }
Exemple #2
0
        public void ToStringOnModeModifierGroupNodeWithChildNodeShouldReturnModeModifierGroupWithChildNodeAfterColon()
        {
            // Arrange
            var childNode = new CharacterNode('a');
            var target    = new ModeModifierGroupNode("imsnx-imsnx", childNode);

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

            // Assert
            result.ShouldBe("(?imsnx-imsnx:a)");
        }
Exemple #3
0
        public void ToStringOnModeModifierGroupNodeWithMultipleChildNodesShouldReturnModeModifierGroupWithChildNodesAfterColon()
        {
            // Arrange
            var childNodes = new List <RegexNode> {
                new CharacterNode('a'), new CharacterNode('b'), new CharacterNode('c')
            };
            var target = new ModeModifierGroupNode("imsnx-imsnx", childNodes);

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

            // Assert
            result.ShouldBe("(?imsnx-imsnx:abc)");
        }
Exemple #4
0
        public void ToStringOnModeModifierGroupNodeWithprefixShouldReturnPrefixBeforeModeModifierGroupNode()
        {
            // Arrange
            var comment = new CommentGroupNode("This is a comment.");
            var target  = new ModeModifierGroupNode("imsnx-imsnx")
            {
                Prefix = comment
            };

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

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