@@ -0,0 +1,1974 @@
+package by.vorokhobko.3_conditional_operator;%0A%0Aimport static org.hamcrest.core.Is.is;%0Aimport static org.junit.Assert.assertThat;%0Aimport static org.hamcrest.number.IsCloseTo.closeTo;%0Aimport org.junit.Test;%0A%0A/**%0A * TriangleTest.%0A *%0A * Class TriangleTest for testing class Triangle.%0A * @author Evgeny Vorokhobko (vorokhobko2011@yandex.ru).%0A * @since 05.12.2016.%0A * @version 1.%0A */%0A%0Apublic class TriangleTest %7B%0A%09  /**%0A%09  * @Test.%0A%09  * Triangle test positive numbers.%0A%09  */%0A%09  @Test%0A%09public void determineTheAreaOfTheTrianglePositiveNumbers() %7B%0A%09%09final double x = 2;%0A%09%09final double y = 5;%0A%09%09final double totalArea = 30.00;%0A%09%09final double numberExeption = 0.01;%0A%09%09final Point pointA = new Point(x, y);%0A%09%09final Point pointB = new Point(x + y, y + y);%0A%09%09final Point pointC = new Point(x * y, y * y);%0A%09%09Triangle triangleABC = new Triangle(pointA, pointB, pointC);%0A%09%09double resultArea = triangleABC.area();%0A%09%09assertThat(resultArea, is(closeTo(totalArea, numberExeption)));%0A%09%09%7D%0A%09  /**%0A%09  * @Test.%0A%09  * Triangle test negative numbers.%0A%09  */%0A%09  @Test%0A%09public void determineTheAreaOfTheTriangleNegativeNumbers() %7B%0A%09%09final double x = -2;%0A%09%09final double y = -5;%0A%09%09final double totalArea = 45.00;%0A%09%09final double numberExeption = 0.01;%0A%09%09final Point pointA = new Point(x, y);%0A%09%09final Point pointB = new Point(x + y, y + y);%0A%09%09final Point pointC = new Point(x * y, y * y);%0A%09%09Triangle triangleABC = new Triangle(pointA, pointB, pointC);%0A%09%09double resultArea = triangleABC.area();%0A%09%09assertThat(resultArea, is(closeTo(totalArea, numberExeption)));%0A%09%09%7D%0A%09  /**%0A%09  * @Test.%0A%09  * Triangle exeption test.%0A%09  */%0A%09%09@Test(expected = Exception.class)%0A%09public void determineTheAreaOfTheTriangleExeption() %7B%0A%09%09final double x = 0.5;%0A%09%09final double y = 1;%0A%09%09final double z = 10;%0A%09%09final Point pointA = new Point(x, y);%0A%09%09final Point pointB = new Point(y, y);%0A%09%09final Point pointC = new Point(z, y);%0A%09%09Triangle triangleABC = new Triangle(pointA, pointB, pointC);%0A%09%09double resultArea = triangleABC.area();%0A%09%09%7D%0A%09%7D

Test class Triangle