示例#1
0
 public void TestAreaTriangleNegative(int a, int b, int c)
 {
     Assert.Throws <Exception>(() =>
     {
         var triangle = new GeometricFigures.Triangle(a, b, c);
         var actualsq = triangle.getAreaTriangle();
     }, "Exception is expected");
 }
示例#2
0
        public void Test_Tringle_Area()
        {
            GeometricFigures.Triangle treygolnik = new GeometricFigures.Triangle(5, 5, 6);

            treygolnik.getAreaTriangle();

            int d = 12;

            Assert.AreEqual(d, treygolnik.getAreaTriangle());
        }
示例#3
0
        public void Test_Tringle_Lenght()
        {
            GeometricFigures.Triangle treygolnik = new GeometricFigures.Triangle(6, 2, 3);

            treygolnik.getLengthTriangle();

            int d = 11;

            Assert.AreEqual(d, treygolnik.getLengthTriangle());
        }
示例#4
0
        public void TestGetLengthTrianglePositive(int a, int b, int c)
        {
            double delta = 0.05;

            {
                double expectedsq = a + b + c;
                GeometricFigures.Triangle triangle = new GeometricFigures.Triangle(a, b, c);
                double actualsq = triangle.getLengthTriangle();
                Assert.AreEqual(expectedsq, actualsq, delta, "It doesn't work with arguments = {0},{1},{2}", a, b, c);
            }
        }
示例#5
0
        public void TestGetAreaTrianglePositive(int a, int b, int c)
        {
            double delta = 0.05;

            {
                double p          = (double)(a + b + c) / 2;
                double expectedsq = Math.Sqrt(p * (p - a) * (p - b) * (p - c));
                GeometricFigures.Triangle square = new GeometricFigures.Triangle(a, b, c);
                double actualsq = square.getAreaTriangle();
                Assert.AreEqual(expectedsq, actualsq, delta, "It doesn't work with arguments ={0},{1},{2}", a, b, c);
            }
        }