Esempio n. 1
0
        public void RightAreaTest()
        {
            RightTriangle triangle=new RightTriangle(3,4,5);

            double area = triangle.Area;

            Assert.AreEqual(6,area,"Right Area");
        }
Esempio n. 2
0
        public static Triangle Type(double a, double b, int c)
        {
            Triangle tr;

            if (a == b)
            {
                tr = new IsoscelesTriangle(a, b, c);
                Console.WriteLine("You got the Isosceles Triangle ");
            }
            else if (c == 90)
            {
                tr = new RightTriangle(a, b, c);
                Console.WriteLine("You got the Right Triangle ");
            }
            else
            {
                tr = new Triangle(a, b, c);
                Console.WriteLine("You got the Simple Triangle ");
            }
            return(tr);
        }
Esempio n. 3
0
 public void ArgumentExceptionTest()
 {
     RightTriangle triangle = new RightTriangle(3, 4, 6);
 }