예제 #1
0
        public void Add2Types()
        {
            GenericCalculator sumTest1 = new GenericCalculator();
            dynamic           num1     = 5.50;
            dynamic           num2     = 6.66f;

            //Act
            dynamic total = sumTest1.Add(num1, num2);

            //Assert
            Assert.AreEqual(12.16, total);
        }
예제 #2
0
        public void AddResultNegative()
        {
            GenericCalculator sumTest1 = new GenericCalculator();
            dynamic           num1     = -10;
            dynamic           num2     = 9;

            //Act
            dynamic total = sumTest1.Add(num1, num2);

            //Assert
            Assert.AreEqual(-1, total);
        }
예제 #3
0
        public void Add()
        {
            GenericCalculator sumTest1 = new GenericCalculator();
            dynamic           num1     = 4;
            dynamic           num2     = 6;

            //Act
            dynamic total = sumTest1.Add(num1, num2);

            //Assert
            Assert.AreEqual(10, total);
        }