Ejemplo n.º 1
0
        public void Cannot_Execute_internal_Method_from_external_object()
        {
            var calculator = new TestCalculator();

            using var engine = new V8ScriptEngine();
            engine.AddHostObject("calculator", calculator);

            engine.Invoking(e => e.Execute(@"
                 calculator.InternalAdd(1,2);
                ")).Should().Throw <ScriptEngineException>().WithMessage("TypeError: calculator.InternalAdd is not a function");
        }