Example #1
0
        public void addNegativeTestMethod()
        {
            double number  = -2;
            double number2 = -4;

            Calculator.Program p = new Calculator.Program();
            Assert.AreEqual(-6, p.add(number, number2));
        }
Example #2
0
        public void addTestMethod()
        {
            Calculator.Program p       = new Calculator.Program();
            double             number  = 8;
            double             number2 = 4;

            Assert.AreEqual(12, p.add(number, number2));
        }
Example #3
0
        public void addMaxValueTestMethod()
        {
            double number  = double.MaxValue - 2;
            double number2 = 4;

            Calculator.Program p = new Calculator.Program();
            try
            {
                p.add(number, number2);
                Assert.Fail();
            }
            catch (OverflowException)
            {
                Assert.Pass();
            }
        }