public void CreateScope_GetEngineWithNoLanguage() { var runtime = ScriptRuntimeTest.CreateRuntime(); var scope = runtime.CreateScope(); Assert.AreNotEqual(scope.Engine, null); }
public void Create_PassUnloadedAppDomain() { AppDomain otherAD = TestHelpers.CreateAppDomain("SecondAppDomain"); //this call is not really needed, but let's have it and use it to check if the domain was //created properly and we were able to execute a create call successfully ScriptRuntime runtime1 = ScriptRuntimeTest.CreateRuntime(otherAD); AppDomain.Unload(otherAD); // This should throw ScriptRuntime runtime2 = ScriptRuntimeTest.CreateRuntime(otherAD); }
public void GetVariableAsHandle_RemoteEngineRemoteValue() { ScriptRuntime env = ScriptRuntimeTest.CreateRuntime(TestHelpers.CreateAppDomain("new domain")); ScriptEngine engine = env.GetEngine("py"); ScriptScope scope = engine.CreateScope(); ScriptSource code = engine.CreateScriptSourceFromString("two=1+1", SourceCodeKind.Statements); code.Execute(scope); ObjectHandle obj = scope.GetVariableHandle("two"); int two = (int)obj.Unwrap(); Assert.AreEqual(two, 2); }
public void Create_NullAppDomain() { ScriptRuntimeTest.CreateRuntime(null); }