public void Given_a_dynamic_expression_And_a_function_is_called_When_invoked_Then_should_execute_evaluation()
        {
            var runtime = new Mock <IJSRuntime>();

            using (dynamic context = new EvalContext(runtime.Object))
            {
                dynamic arg = new EvalContext(runtime.Object);
                (context as EvalContext).Expression = () => context.Do("stuff");
            }
            Verify(runtime, "Do(\"stuff\")");

            using (dynamic context = new EvalContext(runtime.Object))
            {
                dynamic arg = new EvalContext(runtime.Object);
                (context as EvalContext).Expression = () => context.Do(arg.stuff);
            }
            Verify(runtime, "Do(stuff)", 2);

            using (dynamic context = new EvalContext(runtime.Object))
            {
                dynamic arg  = new EvalContext(runtime.Object);
                dynamic arg2 = new EvalContext(runtime.Object);
                (context as EvalContext).Expression = () => context.Do("document", arg2.@this);
            }
            Verify(runtime, "Do(\"document\", this)", 3);
        }
        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
        }