Beispiel #1
0
        public void CalculateTest2()
        {
            IExpression exp = new XOr(new Number(1), new Number(2.5));

            Assert.AreEqual(2, exp.Calculate());
        }
Beispiel #2
0
        public void CalculateTest4()
        {
            var exp = new XOr(new Bool(false), new Bool(true));

            Assert.AreEqual(true, exp.Calculate());
        }
Beispiel #3
0
        public void ResultTypeBoolVarTest()
        {
            var exp = new XOr(new Bool(true), new Variable("x"));

            Assert.Equal(ExpressionResultType.Boolean, exp.ResultType);
        }
Beispiel #4
0
        public void ResultTypeNumberNumberTest()
        {
            var exp = new XOr(new Number(2), new Number(4));

            Assert.Equal(ExpressionResultType.Number, exp.ResultType);
        }
Beispiel #5
0
        public void ResultTypeBoolBoolTest()
        {
            var exp = new XOr(new Bool(true), new Bool(false));

            Assert.Equal(ExpressionResultType.Boolean, exp.ResultType);
        }
Beispiel #6
0
        public void ExecuteTest4()
        {
            var exp = new XOr(new Bool(false), new Bool(true));

            Assert.Equal(true, exp.Execute());
        }
Beispiel #7
0
        public void ExecuteTest2()
        {
            var exp = new XOr(new Number(1), new Number(2.5));

            Assert.Equal(2.0, exp.Execute());
        }
Beispiel #8
0
        public void ResultTypeVerVarTest()
        {
            var exp = new XOr(new Variable("y"), new Variable("x"));

            Assert.Equal(ExpressionResultType.Number | ExpressionResultType.Boolean, exp.ResultType);
        }
Beispiel #9
0
        public void ResultTypeVarNumTest()
        {
            var exp = new XOr(new Variable("x"), new Number(1));

            Assert.Equal(ExpressionResultType.Number, exp.ResultType);
        }