public static void DefineCtorFunction(string code, int expectedWidth, int expectedHeight) { var global = new TestingGlobal(); var jsEngine = new JurassicJsEngine(global); var img = (Img)jsEngine.Evaluate(code); Assert.That(img.Width, Is.EqualTo(expectedWidth), "Width"); Assert.That(img.Height, Is.EqualTo(expectedHeight), "Height"); }
public static void CallCtorFunction(string code, int expectedWidth, int expectedHeight) { var global = new TestingGlobal(); var jsEngine = new JintJsEngine(global); var img = (Img)jsEngine.Evaluate(code); Assert.AreEqual(img.Width, expectedWidth, "Width"); Assert.AreEqual(img.Height, expectedHeight, "Height"); }