Exemple #1
0
        public void BoolTrueAndFalseEqualTest()
        {
            var equal  = new Equal(new Bool(true), new Bool(false));
            var result = (bool)equal.Execute();

            Assert.Equal(false, result);
        }
Exemple #2
0
        public void NumberEqualTest()
        {
            var equal  = new Equal(new Number(10), new Number(10));
            var result = (bool)equal.Execute();

            Assert.Equal(true, result);
        }
Exemple #3
0
        public void BoolTrueEqualTest()
        {
            var equal  = new Equal(new Bool(true), new Bool(true));
            var result = (bool)equal.Execute();

            Assert.True(result);
        }
Exemple #4
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));
        }
Exemple #5
0
        public void BoolTrueVarEqualTest()
        {
            var parameters = new ParameterCollection()
            {
                new Parameter("x", true),
                new Parameter("y", true)
            };
            var equal  = new Equal(new Variable("x"), new Variable("y"));
            var result = (bool)equal.Execute(parameters);

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

            Assert.False(result);
        }
Exemple #7
0
        public void NumberVarEqualTest()
        {
            var parameters = new ParameterCollection()
            {
                new Parameter("x", 10),
                new Parameter("y", 10)
            };
            var equal  = new Equal(Variable.X, new Variable("y"));
            var result = (bool)equal.Execute(parameters);

            Assert.True(result);
        }
Exemple #8
0
        public void CalculateInvalidParametersTest()
        {
            var equal = new Equal(new ComplexNumber(3, 2), new ComplexNumber(3, 2));

            Assert.Throws <ResultIsNotSupportedException>(() => equal.Execute());
        }