public void PythonExecuteScriptWithDotTest()
        {
            var result = DynamicScriptRuntime.Execute(@"
import sys
ds_python_result = u'你好 python'
ds_python_result = ds_python_result + '2.7'"
                                                      , ".py");

            result.ShouldBe("你好 python2.7");
        }
        public void RubyExecuteScriptWithDotTest()
        {
            var result = DynamicScriptRuntime.Execute(@"		
class DsRubyClass  
  def Invoke  
	'Hello ruby!'
  end  
end
            ", ".rb");

            result.ShouldBe("Hello ruby!");
        }
Beispiel #3
0
        public void LuaExecuteScriptWithDotTest()
        {
            var result = DynamicScriptRuntime.Execute(@"		
                            function fact (n)
			                    if (n == 0) then
				                    return 1
			                    else
				                    return n*fact(n - 1)
			                    end
		                    end
		                    return fact(5)
            ", ".lua");

            result.ShouldBe("120");
        }
        public void RubyExecuteFileTest()
        {
            var result = DynamicScriptRuntime.Execute("Ruby/demo.rb");

            result.ShouldBe("Hello ruby!");
        }
        public void PythonExecuteFileTest()
        {
            var result = DynamicScriptRuntime.Execute("Python/demo.py");

            result.ShouldBe("你好 python2.7");
        }
Beispiel #6
0
        public void LuaExecuteFileTest()
        {
            var result = DynamicScriptRuntime.Execute("Lua/demo.lua");

            result.ShouldBe("120");
        }