Пример #1
0
 def test_InvalidInput(self):
     self.assertEqual(classify_triangle(0, 1, 2), 'InvalidInput')
     self.assertEqual(classify_triangle(1, 0, 2), 'InvalidInput')
     self.assertEqual(classify_triangle(2, 1, 0), 'InvalidInput')
     self.assertEqual(classify_triangle(-3, 1, 2), 'InvalidInput')
     self.assertEqual(classify_triangle(1, -3, 2), 'InvalidInput')
     self.assertEqual(classify_triangle(2, 1, -3), 'InvalidInput')
     self.assertEqual(classify_triangle(300, 150, 200), 'InvalidInput')
     self.assertEqual(classify_triangle(90, 201, 100), 'InvalidInput')
     self.assertEqual(classify_triangle(59, 90, 203), 'InvalidInput')
     self.assertEqual(classify_triangle(1, 0.1, 2), 'InvalidInput')
     self.assertEqual(classify_triangle('A', 1, 2), 'InvalidInput')
Пример #2
0
 def test_NotvalidTriangles(self):
     self.assertEqual(classify_triangle(5, 9, 3), 'NotATriangle')
Пример #3
0
 def test_ScaleneTriangles(self):
     self.assertEqual(classify_triangle(1, 3, 2), 'Scalene')
Пример #4
0
 def test_IsocelesTriangles(self):
     self.assertEqual(classify_triangle(3, 3, 1), 'Isoceles')
     self.assertEqual(classify_triangle(2, 3, 2), 'Isoceles')
     self.assertEqual(classify_triangle(3, 2, 2), 'Isoceles')
Пример #5
0
 def test_EquilateralTriangles(self):
     self.assertEqual(classify_triangle(1, 1, 1), 'Equilateral')
Пример #6
0
 def test_RightTriangleA(self):
     self.assertEqual(classify_triangle(3, 4, 5), 'Right')
     self.assertEqual(classify_triangle(5, 3, 4), 'Right')