private object Run(string script, Dictionary <string, object> variables = null) { var resolver = new BindingResolver { CultureInfo = CultureInfo.InvariantCulture }; if (variables == null) { return(resolver.Resolve(script)); } return(resolver.Resolve(script, variables)); }
public void Resolve_CustomMiddleware_ShouldBeAbleToRunCustomMiddlewareFunctionAndStandardFunction() { // Setup test var resolver = new BindingResolver { CultureInfo = CultureInfo.InvariantCulture }; resolver.UseRunner(new ObjectMethodRunner(new InvokerFunctionsMock())); // Run test var result = resolver.Resolve("X={one()+ToString(5)}"); // Evaluate result Assert.Equal("X=15", result); }