public void Match()
    {
        // Given
        var expression = new TransformExpression(
            new TextExpression("x"),
            new TextExpression("y"));

        // When
        var result = expression.Transform("x");

        // Then
        Assert.Equal("y", result);
    }
Example #2
0
    public void OpenCapture()
    {
        // Given
        var expression = new TransformExpression(
            new PassExpression(),
            new CaptureExpression("foo", new BackreferenceExpression("foo"))
            );

        // When
        var result = expression.Transform("");

        // Then
        Assert.Null(result);
    }