Пример #1
0
        public void CanCompileEmptyScriptTwice()
        {
            var scriptApi = new ScriptApi();

            scriptApi.CompileWrappedScript <TestScriptArity4>("");
            scriptApi.CompileWrappedScript <TestScriptArity4>("");
        }
Пример #2
0
        public void CanCompileEmptyScriptTwice()
        {
            var scriptApi = new ScriptApi();

            scriptApi.CompileWrappedScript<TestScriptArity4>("");
            scriptApi.CompileWrappedScript<TestScriptArity4>("");
        }
Пример #3
0
        public void CanCompileTypedScript()
        {
            var factory = new ScriptApi();

            var script = factory.CompileWrappedScript<TestScript>("throw new Exception()");

            Assert.Throws<Exception>(script.Run);
        }
Пример #4
0
        public void CanCompileTypedScript()
        {
            var factory = new ScriptApi();

            var script = factory.CompileWrappedScript <TestScript>("throw new Exception()");

            Assert.Throws <Exception>(script.Run);
        }
Пример #5
0
        public void Wrapped()
        {
            var scriptApi     = new ScriptApi();
            var wrappedScript = scriptApi.CompileWrappedScript <HappyScript>("Mood(\"Happy!\")");

            string result = wrappedScript.Run();

            result.ShouldEqual("Happy!");
        }
Пример #6
0
        public void Wrapped()
        {
            var scriptApi = new ScriptApi();
            var wrappedScript = scriptApi.CompileWrappedScript<HappyScript>("Mood(\"Happy!\")");

            string result = wrappedScript.Run();

            result.ShouldEqual("Happy!");
        }
Пример #7
0
        public void SupportsGenericArity1()
        {
            var script = _scriptApi.CompileWrappedScript <TestScriptArity1>("throw new Exception()");

            Assert.Throws <Exception>(script.Run);
        }