public void ScriptingContext_GivenPythonScript_ShouldReturnPythonScriptHandleType()
        {
            var context = new ScriptingEngineRepo();

            if (context.CreateEngine(enScriptType.JavaScript, new StringScriptSources()) is JavaScriptContext scriptingContext)
            {
                Assert.AreEqual(enScriptType.JavaScript, scriptingContext.HandlesType());
            }
        }
Ejemplo n.º 2
0
        public void ScriptingContext_GivenRubyScript_ShouldReturnRubyScriptHandleType()
        {
            var context          = new ScriptingEngineRepo();
            var scriptingContext = context.CreateEngine(enScriptType.Ruby, new StringScriptSources()) as RubyContext;

            if (scriptingContext != null)
            {
                Assert.AreEqual(enScriptType.Ruby, scriptingContext.HandlesType());
            }
        }
Ejemplo n.º 3
0
        public void ScriptingContext_GivenRubyScript_ShouldSetNestedClassValues()
        {
            var context          = new ScriptingEngineRepo();
            var scriptingContext = context.CreateEngine(enScriptType.Ruby, new StringScriptSources()) as RubyContext;

            Assert.IsNotNull(scriptingContext);
            var prObject = new PrivateObject(scriptingContext);

            Assert.IsNotNull(prObject);
            Assert.IsNull(scriptingContext.RuntimeSetup);
            prObject.Invoke("CreateRubyEngine");
            Assert.IsNotNull(scriptingContext.RuntimeSetup);
        }