Пример #1
0
 public void TestExceptionThrowing()
 {
     Assert.Throws(typeof(TriangleException),
                   () => {
         RightTriangle.GetSquare(-0.3, 0.5);
     });
     Assert.Throws(typeof(TriangleException),
                   () => {
         RightTriangle.GetSquare(1.3, -1.5);
     });
     Assert.Throws(typeof(TriangleException),
                   () => {
         RightTriangle.GetSquare(Double.NaN, 0.3);
     });
 }
Пример #2
0
 public void TestSquareComputation(double a, double b, double expected_square)
 {
     Assert.AreEqual(RightTriangle.GetSquare(a, b), expected_square);
 }