Beispiel #1
0
        //A simple test to assure ourselves 2 + 2 = 4
        public void Math_Add_Input2And2_AssertAnswer4()
        {
            //Arrange
            int x = 2;
            int y = 2;

            UnitTests.Math math = new UnitTests.Math();

            //Act
            int sum = math.Add(x, y);

            //Assert
            Assert.AreEqual(sum, 4);
        }
Beispiel #2
0
        //What about two negative numbers?
        public void Math_Add_InputNegative2AndNegative2_AssertAnswerNegative4()
        {
            //Arrange
            int x = -2;
            int y = -2;

            UnitTests.Math math = new UnitTests.Math();

            //Act
            int sum = math.Add(x, y);

            //Assert
            Assert.AreEqual(sum, -4);
        }