Esempio n. 1
0
        public void BoolTrueEqualTest()
        {
            var equal = new Equal(new Bool(true), new Bool(true));
            var result = (bool)equal.Execute();

            Assert.Equal(true, result);
        }
Esempio n. 2
0
        public void BoolTrueAndFalseVarEqualTest()
        {
            var parameters = new ParameterCollection()
            {
                new Parameter("x", true),
                new Parameter("y", false)
            };
            var equal = new Equal(new Variable("x"), new Variable("y"));
            var result = (bool)equal.Execute(parameters);

            Assert.Equal(false, result);
        }
Esempio n. 3
0
        public void NumberEqualTest()
        {
            var equal = new Equal(new Number(10), new Number(10));
            var result = (bool)equal.Execute();

            Assert.Equal(true, result);
        }
Esempio n. 4
0
        public void NumberVarEqualTest()
        {
            var parameters = new ParameterCollection()
            {
                new Parameter("x", 10),
                new Parameter("y", 10)
            };
            var equal = new Equal(new Variable("x"), new Variable("y"));
            var result = (bool)equal.Execute(parameters);

            Assert.Equal(true, result);
        }
Esempio n. 5
0
        public void NumberAndBoolVarEqualTest()
        {
            var parameters = new ParameterCollection()
            {
                new Parameter("x", 10),
                new Parameter("y", false)
            };
            var equal = new Equal(new Variable("x"), new Variable("y"));

            Assert.Throws<NotSupportedException>(() => (bool)equal.Execute(parameters));
        }