Beispiel #1
0
        static void Main(string[] args)
        {
            double[] input = new double[3];
            //input[0] = 3;
            //input[1] = 4;
            //input[2] = 5;

            for (int i = 0; i < 3; i++)
            {
                input[i] = double.Parse(args[i]);
            }

            Triangle t = new Triangle(input);

            if (t.isScalene())
            {
                Console.WriteLine("Triangeln har inga lika sidor");
            }
            if (t.isEquilateral())
            {
                Console.WriteLine("Triangeln är liksidig");
            }
            if (t.isIsosceles())
            {
                Console.WriteLine("Triangeln är likbent");
            }
        }
Beispiel #2
0
 public void isScaleneTest()
 {
     Triangle tri = new Triangle(5.0, 4.0, 3.0);
     Assert.IsTrue(tri.isScalene());
 }
Beispiel #3
0
 public void isIsoscelesTest3()
 {
     Triangle tri = new Triangle(5.0, 5.0, 5.0);
     Assert.IsFalse(tri.isIsosceles());
 }
Beispiel #4
0
 public void isIsoscelesTest2()
 {
     Triangle tri = new Triangle(2.0, 1.0, 3.0);
     Assert.IsFalse(tri.isIsosceles());
 }
Beispiel #5
0
 public void isIsoscelesTest()
 {
     Triangle tri = new Triangle(3.0, 3.0, 1.0);
     Assert.IsTrue(tri.isIsosceles());
 }
Beispiel #6
0
 public void isEquilateralTest3()
 {
     Triangle tri = new Triangle(2.0, 1.0, 3.0);
     Assert.IsFalse(tri.isEquilateral());
 }
Beispiel #7
0
 public void isEquilateralTest2()
 {
     Triangle tri = new Triangle(3.0, 5.0, 5.0);
     Assert.IsFalse(tri.isEquilateral());
 }
Beispiel #8
0
 public void negativeNumbers()
 {
     Triangle tri = new Triangle(-5, -5, -10);
     Assert.IsTrue(tri.isIsosceles());
 }
Beispiel #9
0
 public void differentNumbers3()
 {
     double[] many = new double[] { 1.2, 1.3, 1.8, 1.8, 1.3, 1.2}; // kan stoppa in hur många sidor jag vill bara sålänge det inte är mer än 3 unika
     Triangle tri = new Triangle(many);
     Assert.IsFalse(tri.isEquilateral());
 }
Beispiel #10
0
 public void differentNumbers2()
 {
     double[] two = new double[] { 5.5, 5.5 };
     Triangle tri = new Triangle(two);
     Assert.IsFalse(tri.isScalene());
 }
Beispiel #11
0
        public void pointTest3()
        {
            Point[] point = new Point[4];
            point[0] = new Point(0, 0);
            point[1] = new Point(0, 10);
            point[2] = new Point(20, 10);
            point[3] = new Point(20, 0);
            Triangle tri = new Triangle(point);

            Assert.IsTrue(tri.isIsosceles());
        }
Beispiel #12
0
 public void pointTest2()
 {
     Triangle tri = new Triangle(new Point(0, 20), new Point(0, 20), new Point(0, 20));
     Assert.IsFalse(tri.isScalene());
 }
Beispiel #13
0
 public void differentNumbers1()
 {
     double[] one = new double[] { 20.0 };
     Triangle tri = new Triangle(one);
     Assert.IsFalse(tri.isScalene());
 }
Beispiel #14
0
 public void pointTest()
 {
     Triangle tri = new Triangle(new Point(0, 0), new Point(10, 0), new Point(0, 10));
     Assert.IsTrue(tri.isIsosceles());
 }
Beispiel #15
0
 public void oneNegative()
 {
     Triangle tri = new Triangle(44, 44, -33);
     Assert.IsTrue(tri.isIsosceles());
 }
Beispiel #16
0
 public void isScaleneTest2()
 {
     Triangle tri = new Triangle(5.0, 5.0, 5.0);
     Assert.IsFalse(tri.isScalene());
 }
Beispiel #17
0
 public void isEquilateralTest()
 {
     Triangle tri = new Triangle(5.0, 5.0, 5.0);
     Assert.IsTrue(tri.isEquilateral());
 }
Beispiel #18
0
 public void isScaleneTest3()
 {
     Triangle tri = new Triangle(2.0, 2.0, 8.0);
     Assert.IsFalse(tri.isScalene());
 }