public static IJishInterpreter CreateInterpreter(JSConsole console) { IEngine engine = new JSNetEngine(); engine.SetGlobal("console", console); IKernel kernel = new StandardKernel(new NinjectSettings { UseReflectionBasedInjection = true }); kernel.Bind<IEngine>().ToConstant(engine); kernel.Bind<JSConsole>().ToConstant(console); kernel.Bind<IJishInterpreter>().To<JishInterpreter>().InSingletonScope(); kernel.Bind<ICurrentContextAssemblies>().To<CurrentContextAssemblies>().InSingletonScope(); kernel.Bind<LoadedAssembliesBucket>().ToSelf().InSingletonScope(); return kernel.Get<IJishInterpreter>(); }
public virtual void SetUp() { StandardKernel kernel = new StandardKernel(); IEngine engine = new JSNetEngine(); kernel.Bind<IEngine>().ToConstant(engine); kernel.Bind<ICurrentContextAssemblies>().To<TestCurrentContextAssemblies>(); console = new TestingConsole(); LoadedAssembliesBucket bucket = new LoadedAssembliesBucket(kernel.Get<HelpMgr>(), kernel, console); kernel.Bind<LoadedAssembliesBucket>().ToConstant(bucket); engine.SetGlobal("console", console); kernel.Bind<JSConsole>().ToConstant(console); kernel.Bind<IJishInterpreter>().To<JishInterpreter>().InSingletonScope(); jish = kernel.Get<IJishInterpreter>(); ((JishInterpreter) jish).ThrowErrors = true; }
public void TestInitialize() { js = JsNetHelper.CreateEngine(@"\Scripts\add.js", @"\Scripts\more.js"); }
public void TestInitialize() { js = JsNetHelper.CreateEngine(@"\Scripts\jquery-1.6.2.min.js", @"\Scripts\jquery.stuff.js"); }