Exemplo n.º 1
0
        public void TestEvalOperationEvaluationContextFails()
        {
            OperationEvaluationContext ctx = CreateContext();

            ValueEval[] args = new ValueEval[] { ErrorEval.VALUE_INVALID };
            ValueEval result = new Dec2Hex().Evaluate(args, ctx);

            Assert.AreEqual(typeof(ErrorEval), result.GetType());
            Assert.AreEqual(ErrorEval.VALUE_INVALID, result);
        }
Exemplo n.º 2
0
        public void TestWithEmptyPlaces()
        {
            OperationEvaluationContext ctx = CreateContext();

            ValueEval[] args = new ValueEval[] { ctx.GetRefEval(0, 0), ctx.GetRefEval(1, 0) };
            ValueEval result = new Dec2Hex().Evaluate(args, -1, -1);

            Assert.AreEqual(typeof(ErrorEval), result.GetType());
            Assert.AreEqual(ErrorEval.VALUE_INVALID, result);
        }
Exemplo n.º 3
0
        public void TestWithErrorPlaces()
        {
            OperationEvaluationContext ctx = CreateContext();

            ValueEval[] args = new ValueEval[] { ctx.GetRefEval(0, 0), ErrorEval.NULL_INTERSECTION };
            ValueEval result = new Dec2Hex().Evaluate(args, -1, -1);

            Assert.AreEqual(typeof(ErrorEval), result.GetType());
            Assert.AreEqual(ErrorEval.NULL_INTERSECTION, result);
        }
Exemplo n.º 4
0
        public void TestWithNegativePlaces()
        {
            OperationEvaluationContext ctx = CreateContext();

            ValueEval[] args = new ValueEval[] { ctx.GetRefEval(0, 0), ctx.GetRefEval(0, 2) };
            ValueEval result = new Dec2Hex().Evaluate(args, -1, -1);

            Assert.AreEqual(typeof(ErrorEval), result.GetType());
            Assert.AreEqual(ErrorEval.NUM_ERROR, result);
        }
Exemplo n.º 5
0
        public void TestWithPlaces()
        {
            OperationEvaluationContext ctx = CreateContext();

            ValueEval[] args = new ValueEval[] { ctx.GetRefEval(0, 0), ctx.GetRefEval(0, 1) };
            ValueEval result = new Dec2Hex().Evaluate(args, ctx);

            Assert.AreEqual(typeof(StringEval), result.GetType(), "Had: " + result.ToString());
            Assert.AreEqual("0000007B", ((StringEval)result).StringValue);
        }