Beispiel #1
0
        public void DividingByZeroException()
        {
            // Arrange
            string firstNumber       = "25";
            string secondNumber      = "0";
            SimpleCalcRepository res = new SimpleCalcRepository();

            // Assert
            Assert.Throws <DivideByZeroException>(() =>
                                                  res.Divide(firstNumber, secondNumber)
                                                  );
        }
Beispiel #2
0
        public void CheckingDivision()
        {
            // Arrange
            string firstNumber       = "25";
            string secondNumber      = "5";
            SimpleCalcRepository res = new SimpleCalcRepository();

            // Act
            string actual   = res.Divide(firstNumber, secondNumber);
            string expected = "5";

            // Assert
            Assert.Equal(actual, expected);
        }