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"); } }
public void isScaleneTest() { Triangle tri = new Triangle(5.0, 4.0, 3.0); Assert.IsTrue(tri.isScalene()); }
public void isIsoscelesTest3() { Triangle tri = new Triangle(5.0, 5.0, 5.0); Assert.IsFalse(tri.isIsosceles()); }
public void isIsoscelesTest2() { Triangle tri = new Triangle(2.0, 1.0, 3.0); Assert.IsFalse(tri.isIsosceles()); }
public void isIsoscelesTest() { Triangle tri = new Triangle(3.0, 3.0, 1.0); Assert.IsTrue(tri.isIsosceles()); }
public void isEquilateralTest3() { Triangle tri = new Triangle(2.0, 1.0, 3.0); Assert.IsFalse(tri.isEquilateral()); }
public void isEquilateralTest2() { Triangle tri = new Triangle(3.0, 5.0, 5.0); Assert.IsFalse(tri.isEquilateral()); }
public void negativeNumbers() { Triangle tri = new Triangle(-5, -5, -10); Assert.IsTrue(tri.isIsosceles()); }
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()); }
public void differentNumbers2() { double[] two = new double[] { 5.5, 5.5 }; Triangle tri = new Triangle(two); Assert.IsFalse(tri.isScalene()); }
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()); }
public void pointTest2() { Triangle tri = new Triangle(new Point(0, 20), new Point(0, 20), new Point(0, 20)); Assert.IsFalse(tri.isScalene()); }
public void differentNumbers1() { double[] one = new double[] { 20.0 }; Triangle tri = new Triangle(one); Assert.IsFalse(tri.isScalene()); }
public void pointTest() { Triangle tri = new Triangle(new Point(0, 0), new Point(10, 0), new Point(0, 10)); Assert.IsTrue(tri.isIsosceles()); }
public void oneNegative() { Triangle tri = new Triangle(44, 44, -33); Assert.IsTrue(tri.isIsosceles()); }
public void isScaleneTest2() { Triangle tri = new Triangle(5.0, 5.0, 5.0); Assert.IsFalse(tri.isScalene()); }
public void isEquilateralTest() { Triangle tri = new Triangle(5.0, 5.0, 5.0); Assert.IsTrue(tri.isEquilateral()); }
public void isScaleneTest3() { Triangle tri = new Triangle(2.0, 2.0, 8.0); Assert.IsFalse(tri.isScalene()); }