Rhino.Drivers.JsTestsBase.RunJsTest C# (CSharp) Method

RunJsTest() public method

public RunJsTest ( Context cx, Scriptable shared, string name, string source ) : void
cx Rhino.Context
shared Scriptable
name string
source string
return void
		public virtual void RunJsTest(Context cx, Scriptable shared, string name, string source)
		{
			// create a lightweight top-level scope
			Scriptable scope = cx.NewObject(shared);
			scope.SetPrototype(shared);
			System.Console.Out.Write(name + ": ");
			object result;
			try
			{
				result = cx.EvaluateString(scope, source, "jstest input", 1, null);
			}
			catch (Exception e)
			{
				System.Console.Out.WriteLine("FAILED");
				throw;
			}
			NUnit.Framework.Assert.IsTrue(result != null);
			NUnit.Framework.Assert.IsTrue("success".Equals(result));
			System.Console.Out.WriteLine("passed");
		}