Beispiel #1
0
        public void RaiseIfDivideRealByInteger()
        {
            DivExpression expr = new DivExpression(new ConstantExpression(6.5), new ConstantExpression(2));

            try
            {
                expr.Evaluate(null);
                Assert.Fail();
            }
            catch (Exception ex)
            {
                Assert.IsInstanceOfType(ex, typeof(InvalidCastException));
            }
        }
Beispiel #2
0
        public void DivideTwoIntegersWithTruncation()
        {
            DivExpression expr = new DivExpression(new ConstantExpression(5), new ConstantExpression(2));

            Assert.AreEqual(2, expr.Evaluate(null));
        }
Beispiel #3
0
        public void DivideTwoIntegers()
        {
            DivExpression expr = new DivExpression(new ConstantExpression(6), new ConstantExpression(2));

            Assert.AreEqual(3, expr.Evaluate(null));
        }