public void RegisteredBooleanTypeProcedureDoesExist() { var engine = new Engine(); var captured = default(Object); TypeProcedures.Register <Boolean>(_ => (args, value) => { captured = value; }); engine.Interpret("true(3) = 5"); TypeFunctions.Unregister <Boolean>(); Assert.AreEqual(5.0, captured); }
public void RegisteredBooleanTypeFunctionDoesExist() { var engine = new Engine(); TypeFunctions.Register <Boolean>(_ => args => args[0]); var result = engine.Interpret("true(3)"); TypeFunctions.Unregister <Boolean>(); Assert.AreEqual(3.0, result); }