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!"); }
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!"); }
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!"); }