Example #1
0
        public void AddExcedingUpperLimi()
        {
            Calculator calculator = new Calculator(-100, 100);
            try
            {
                int result = calculator.Add(10, 150);
                Assert.Fail("This should fail: we’re exceding upper limit");
            }
            catch (OverflowException)
            {

                // Ok, the SUT works as expected
            }
        }
Example #2
0
 public void AddWithDifferentArguments()
 {
     Calculator calculator = new Calculator(-100,100);
     int result = calculator.Add(2, 5);
     Assert.AreEqual(7, result);
 }
Example #3
0
 public void Add()
 {
     Calculator calculator = new Calculator(-100,100);
     int result = calculator.Add(2, 2);
     Assert.AreEqual(4, result);
 }