public void TestEvalOperationEvaluationContext() { OperationEvaluationContext ctx = CreateContext(); ValueEval[] args = new ValueEval[] { ctx.GetRefEval(0, 0) }; ValueEval result = new Hex2Dec().Evaluate(args, ctx); Assert.AreEqual(typeof(NumberEval), result.GetType()); Assert.AreEqual("0", ((NumberEval)result).StringValue); }
public void TestEvalOperationEvaluationContextFails() { OperationEvaluationContext ctx = CreateContext(); ValueEval[] args = new ValueEval[] { ctx.GetRefEval(0, 0), ctx.GetRefEval(0, 0) }; ValueEval result = new Hex2Dec().Evaluate(args, ctx); Assert.AreEqual(typeof(ErrorEval), result.GetType()); Assert.AreEqual(ErrorEval.VALUE_INVALID, result); }