package by.vorokhobko;

import static org.hamcrest.core.Is.is;
import static org.junit.Assert.assertThat;
import static org.hamcrest.number.IsCloseTo.closeTo;
import org.junit.Test;

/**
 * TriangleTest.
 *
 * Class TriangleTest for testing class Triangle.
 * @author Evgeny Vorokhobko (vorokhobko2011@yandex.ru).
 * @since 05.12.2016.
 * @version 1.
 */

public class TriangleTest {
	  /**
	  * @Test.
	  * Point test.
	  */
	  @Test
	public void determineTheAreaOfTheTriangle() {
		final double x = 2;
		final double y = 5;
		final double totalArea = 34.971;
		final double numberExeption = 0.01;
		final Point pointA = new Point(x, y);
		final Point pointB = new Point(x + y, y + y);
		final Point pointC = new Point(x * y, y * y);
		final Triangle triangleABC = new Triangle(pointA, pointB, pointC);
		double resultArea = triangleABC.area();
		assertThat(resultArea, is(closeTo(totalArea, numberExeption)));
		}
	}
@@ -909,10 +909,486 @@
 ));%0A%09%09%7D%0A
+%09%09@Test%0A%09public void determineTheAreaOfTheTriangleExeption() %7B%0A%09%09final double x = 2;%0A%09%09final double y = 3;%0A%09%09final double z = 5;%0A%09%09final Point pointA = new Point(x, y);%0A%09%09final Point pointB = new Point(y - x, y - x);%0A%09%09final Point pointC = new Point(z * x, z * y);%0A%09%09try %7B%0A%09%09%09final Triangle triangleABC = new Triangle(pointA, pointB, pointC);%0A%09%09%09double resultArea = triangleABC.area();%0A%09%09%7D catch (ArithmeticException e) %7B%0A%09%09%09System.out.println(%22Cound not take by 0%22);%0A%09%09%7D%0A%09%09%7D%0A
 %09%7D

add mod