예제 #1
0
        public void ModOpTest()
        {
            Node   op       = NodeFac.Create('%');
            double actual   = ((OpNode)op).Calculate(3, 2);
            double expected = 1;

            Assert.Equal(actual, expected);
        }
예제 #2
0
        public void NullOpTest()
        {
            Node   op       = NodeFac.Create('a');
            double actual   = ((OpNode)op).Calculate(6, 2);
            double expected = 0;

            Assert.Equal(actual, expected);
        }
예제 #3
0
        public void DivideTest()
        {
            Node   op       = NodeFac.Create('/');
            double actual   = ((OpNode)op).Calculate(6, 2);
            double expected = 3;

            Assert.Equal(actual, expected);
        }
예제 #4
0
        public void MultiplyTest()
        {
            Node   op       = NodeFac.Create('*');
            double actual   = ((OpNode)op).Calculate(4, 2);
            double expected = 8;

            Assert.Equal(actual, expected);
        }
예제 #5
0
        public void SubtractTest()
        {
            Node   op       = NodeFac.Create('-');
            double actual   = ((OpNode)op).Calculate(4, 2);
            double expected = 2;

            Assert.Equal(actual, expected);
        }
예제 #6
0
        public void AddTest()
        {
            Node   op       = NodeFac.Create('+');
            double actual   = ((OpNode)op).Calculate(4, 2);
            double expected = 6;

            Assert.Equal(actual, expected);
        }