public void Given_a_dynamic_expression_And_a_function_is_called_And_context_is_reused_When_invoked_Then_should_not_throw_exception() { var runtime = new Mock <IJSRuntime>(); using (dynamic context = new EvalContext(runtime.Object)) { dynamic arg = new EvalContext(runtime.Object); dynamic arg2 = new EvalContext(runtime.Object); dynamic arg3 = new EvalContext(runtime.Object); (context as EvalContext).Expression = () => context.Do(arg.document, arg2.@this); context.After(arg3.that); } //todo: prevent bad syntax }