Example #1
0
 public void Equilateral_DiffrentValues()
 {
     Triangle myTriangle = new Triangle(123.5, 134.1, 1223.1);
     Assert.IsFalse(myTriangle.isEquilateral());
 }
Example #2
0
 public void Equilateral_SameValues()
 {
     Triangle myTriangle = new Triangle(100, 100, 100);
     Assert.IsTrue(myTriangle.isEquilateral());
 }
Example #3
0
        public void TriangleConstructorPointsArray()
        {
            Point cordinateOne = new Point(0, 0);
            Point cordinateTwo = new Point(0, 5);
            Point cordinateThree = new Point(0, 5);

            Point[] cordinates = new Point[3] { cordinateOne, cordinateTwo, cordinateThree };

            Triangle cordinateTriangle = new Triangle(cordinates);
        }
Example #4
0
        public void TriangleConstructorThreeValues()
        {
            // Testar att skapa en triangel genom standardkonstruktor och korrekt antal värden
            Triangle myTriangle = new Triangle(41.5, 15.5, 21.5);

            // Testar att skapa en triangel genom arraykonstruktor och korrekt antal värden
            // Osäker på denna, points istället?
            double[] triangleValues = { 41.5, 15.5, 21.5 };
            Triangle myTriangle2 = new Triangle(triangleValues);
        }
Example #5
0
            public void TriangleAreaTest(double a, double b, double c, double result)
            {
                Triangle triangle = new Triangle(a, b, c);

                Assert.AreEqual(triangle.CalculateArea(), result, 0.05);
            }
Example #6
0
 public void Scalene_ValueOfZero()
 {
     Triangle myTriangle = new Triangle(0, 0, 0);
     Assert.IsFalse(myTriangle.isScalene());
 }
Example #7
0
 public void AllSidesAreNegaive()
 {
     Assert.IsFalse(Triangle.IsTriangle(-3, -4, -5));
 }
Example #8
0
 public void Scalene_AccurateValues()
 {
     Triangle myTriangle = new Triangle(10.0, 20.0, 30.0);
     Assert.IsTrue(myTriangle.isScalene());
 }
Example #9
0
 public void AllSidesAreZero()
 {
     Assert.IsFalse(Triangle.IsTriangle(0, 0, 0));
 }
Example #10
0
 public void OneSideIsNegative()
 {
     Assert.IsFalse(Triangle.IsTriangle(-3, 4, 5));
 }
Example #11
0
 public void OneSideIsZero()
 {
     Assert.IsFalse(Triangle.IsTriangle(0, 2, 4));
 }
Example #12
0
 public void HugeTriangle()
 {
     Assert.IsTrue(Triangle.IsTriangle(57961, 41335, 37546));
 }
Example #13
0
 public void TwoSidesAreEqual()
 {
     Assert.IsTrue(Triangle.IsTriangle(8, 8, 10));
 }
Example #14
0
 public void Isosceles_AccurateValues()
 {
     Triangle myTriangle = new Triangle(6, 5, 6);
     Assert.IsTrue(myTriangle.isIsosceles());
 }
Example #15
0
 public void ImpossibleTriangle()
 {
     Assert.IsFalse(Triangle.IsTriangle(10, 1, 124));
 }
Example #16
0
 public void Isosceles_Same()
 {
     Triangle myTriangle = new Triangle(100, 100, 100);
     Assert.IsFalse(myTriangle.isIsosceles());
 }
Example #17
0
 public void IsRightTriangle()
 {
     Assert.IsTrue(Triangle.IsTriangle(2, 6, 7));
 }
Example #18
0
 public void EgyptTriangle()
 {
     Assert.IsTrue(Triangle.IsTriangle(3, 4, 5));
 }
Example #19
0
        public void Triangle_Right_Check()
        {
            var triangle = new Triangle(3, 4, 5);

            Assert.AreEqual(true, triangle.IsRight);
        }
Example #20
0
            public void RectangularTriangleTest(double a, double b, double c, bool result)
            {
                Triangle triangle = new Triangle(a, b, c);

                Assert.AreEqual(triangle.CheckRectangular(), result);
            }
        public void IsTriangleIsosceles_Isosceles_True()
        {
            Triangle testIsosceles = new Triangle();

            Assert.AreEqual(true, testIsosceles.IsTriangleIsosceles(3, 3, 2));
        }
Example #22
0
        public void TriangleConstructorPoints()
        {
            Point cordinateOne = new Point(-5, 0);
            Point cordinateTwo = new Point(0, 5);
            Point cordinateThree = new Point(5, 0);

            Triangle cordinateTriangle = new Triangle(cordinateOne, cordinateTwo, cordinateThree);
            Assert.IsFalse(cordinateTriangle.isScalene());
        }
        public void IsTriangleScalene_Scalene_True()
        {
            Triangle testScalene = new Triangle();

            Assert.AreEqual(true, testScalene.IsTriangleScalene(1, 2, 3));
        }
Example #24
0
 public void TriangleConstructorPointsArrayTwoValues()
 {
     Point cordinateOne = new Point(0, 0);
     Point cordinateTwo = new Point(0, 5);
     Point[] cordinates = new Point[2] { cordinateOne, cordinateTwo };
     Triangle cordinateTriangle = new Triangle(cordinates);
     Assert.IsFalse(cordinates.Length != 3);
 }
        public void IsNotATriangle_NotATriangle_True()
        {
            Triangle testNotATriangle = new Triangle();

            Assert.AreEqual(true, testNotATriangle.IsNotTriangle(3, 3, 9));
        }
Example #26
0
 public void TriangleConstructorTwoValues()
 {
     // Testar att skapa en triangel genom arryay och fel antal värden
     double[] triangleValuesWrong = { 41.5, 15.5 };
     Triangle myTriangle = new Triangle(triangleValuesWrong);
     //Assert.IsFalse(triangleValuesWrong[0] == 41.5 && triangleValuesWrong[1] == 15.5);
 }
        public void WhatTypeTriangle_TypeOfTriangle_TypeOfTriangleString()
        {
            Triangle testTriangle = new Triangle();

            Assert.AreEqual("not a triangle", testTriangle.WhatTypeTriangle(3, 3, 9));
        }
Example #28
0
 public void Equilateral_NegativeValues()
 {
     Triangle myTriangle = new Triangle(-123.5, -134.1, -1223.1);
     Assert.IsFalse(myTriangle.isEquilateral());
 }
        public void IsTriangleEquilateral_Equilateral_True()
        {
            Triangle testEquilateral = new Triangle();

            Assert.AreEqual(true, testEquilateral.IsTriangleEquilateral(3, 3, 3));
        }
Example #30
0
 public void Equilateral_ValueOfZero()
 {
     Triangle myTriangle = new Triangle(0, 0, 0);
 }
Example #31
0
        public void IsTriangleRight(double a, double b, double c, bool isValid)
        {
            IShape triangle = new Triangle(a, b, c);

            Assert.AreEqual(isValid, ((Triangle)triangle).IsRight());
        }
Example #32
0
 public void Isosceles_DiffrentValues()
 {
     Triangle myTriangle = new Triangle(136, 258, 124);
     Assert.IsFalse(myTriangle.isIsosceles());
 }
            public void When_All_Sides_Of_The_Triangle_Are_The_Same_Length_Then_The_Triangle_Should_Be_Equilateral()
            {
                var triangle = new Triangle(1,1,1);

                _triangleClassifier.ClassifyTriangle(triangle);
            }
Example #34
0
 public void Isosceles_ValueOfZero()
 {
     Triangle myTriangle = new Triangle(0, 0, 0);
     Assert.IsFalse(myTriangle.isIsosceles());
 }
 public TriangleType ClassifyTriangle(Triangle triangle)
 {
     return TriangleType.Equilateral;
 }
Example #36
0
 public void Scalene_NegativeValues()
 {
     Triangle myTriangle = new Triangle(-16, -14, -12);
 }
Example #37
0
 public void AllSidesAreEqual()
 {
     Assert.IsTrue(Triangle.IsTriangle(5, 5, 5));
 }