Exemple #1
0
        public void ValidTestCase()
        {
            TriangleTypes triangleType = TrianglesManager.GetTriangleType(1.5, 2.0, 1.4);

            Assert.AreEqual(TriangleTypes.Scalene, triangleType);

            triangleType = TrianglesManager.GetTriangleType(5, 5, 4);

            Assert.AreEqual(TriangleTypes.Isosceles, triangleType);

            triangleType = TrianglesManager.GetTriangleType(3, 3, 4);

            Assert.AreEqual(TriangleTypes.Isosceles, triangleType);

            triangleType = TrianglesManager.GetTriangleType(5, 5, 5);

            Assert.AreEqual(TriangleTypes.Equilateral, triangleType);
        }
Exemple #2
0
        public void InvalidTestCase()
        {
            TriangleTypes triangleType = TrianglesManager.GetTriangleType(0, 1, 1);

            Assert.AreEqual(TriangleTypes.Invalid, triangleType);

            triangleType = TrianglesManager.GetTriangleType(1, 0, 1);

            Assert.AreEqual(TriangleTypes.Invalid, triangleType);

            triangleType = TrianglesManager.GetTriangleType(1, 1, 0);

            Assert.AreEqual(TriangleTypes.Invalid, triangleType);

            triangleType = TrianglesManager.GetTriangleType(100, 1, 1);

            Assert.AreEqual(TriangleTypes.Invalid, triangleType);

            triangleType = TrianglesManager.GetTriangleType(-1, 1, 1);

            Assert.AreEqual(TriangleTypes.Invalid, triangleType);
        }