public void ToStringOnEmptyModeModifierGroupNodeShouldReturnModeModifierGroupWithModifiers() { // Arrange var target = new ModeModifierGroupNode("imsnx-imsnx"); // Act var result = target.ToString(); // Assert result.ShouldBe("(?imsnx-imsnx)"); }
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)"); }
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)"); }
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)"); }