コード例 #1
0
        public void Divide_DenominatorZero_ShouldThrowDivideByZeroException()
        {
            var cmc = new ComplexMathClass();

            //cmc.Divide(5, 0);
            Assert.Throws <DivideByZeroException>(() => cmc.Divide(5, 0));
        }
コード例 #2
0
        public void Add_TwoIntegers_ShouldCalculateCorrectly(int x, int y, int expectedResult)
        {
            var cmc          = new ComplexMathClass();
            int actualResult = cmc.Add(x, y);

            Assert.Equal <int>(expectedResult, actualResult);
        }
コード例 #3
0
 public void Divide_DenominatorZero_ShouldThrowDivideByZeroException()
 {
     var cmc = new ComplexMathClass();
     //cmc.Divide(5, 0);
     Assert.Throws<DivideByZeroException>(() => cmc.Divide(5, 0));
 }
コード例 #4
0
 public void Add_TwoIntegers_ShouldCalculateCorrectly(int x, int y, int expectedResult)
 {
     var cmc = new ComplexMathClass();
     int actualResult = cmc.Add(x, y);
     Assert.Equal<int>(expectedResult, actualResult);
 }
コード例 #5
0
 public void Divide_DenominatorZero_ShouldThrowDivideByZeroException()
 {
     var cmc = new ComplexMathClass();
     double result = cmc.Divide(5, 0);
 }
コード例 #6
0
 public int Add_TwoIntegers_ShouldCalculateCorrectly(int x, int y)
 {
     var cmc = new ComplexMathClass();
     return cmc.Add(x, y);
 }
コード例 #7
0
        public void Divide_DenominatorZero_ShouldThrowDivideByZeroException()
        {
            var cmc = new ComplexMathClass();

            cmc.Divide(5, 0);
        }
コード例 #8
0
        public int Add_TwoIntegers_ShouldCalculateCorrectly(int x, int y)
        {
            var cmc = new ComplexMathClass();

            return(cmc.Add(x, y));
        }