示例#1
0
        public void HelloWorld()
        {
            var scriptApi = new ScriptApi();
            var script = scriptApi.CompileScript<HelloWorldEnvironment>("DoIt()");

            var environment = new HelloWorldEnvironment();
            script.Run(environment);

            environment.Result.ShouldEqual("Hello World!");
        }
示例#2
0
        public void HelloWorld()
        {
            var scriptApi = new ScriptApi();
            var script    = scriptApi.CompileScript <HelloWorldEnvironment>("DoIt()");

            var environment = new HelloWorldEnvironment();

            script.Run(environment);

            environment.Result.ShouldEqual("Hello World!");
        }
示例#3
0
        public void MultipleEnvironments()
        {
            var scriptApi = new ScriptApi();
            var script    = scriptApi.CompileScript <HelloWorldEnvironment, GeneralPurposeEnvironment>("DoIt(GetRandom(42))");

            var helloEnvironment   = new HelloWorldEnvironment();
            var generalEnvironment = new GeneralPurposeEnvironment();

            script.Run(helloEnvironment, generalEnvironment);

            helloEnvironment.Result.ShouldEqual("Hello 28!");
        }