package ru.job4j.condition;

import org.junit.Test;

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

/**
* This class is test for class Triangle.
*
* @author Kucyh Vasily (mailto:basil135@mail.ru)
* @version $Id$
* @since 01.04.2017
*/
public class TriangleTest {

	/**
	* This method is not calculate the area of triangle, because the triangle does not exist, result set negative one.
	*/
	@Test
	public void whenTriangleDoesNotExistThenNegativeOne() {

		double expectedValue;
		double actualValue;

		Triangle triangle = new Triangle(new Point(2, 2), new Point(2, 2), new Point(2, 2));

		expectedValue = -1D;
		actualValue = triangle.area();

		assertThat(actualValue, is(expectedValue));

	}

	/**
	* This method is calculate the area of triangle.
	*/
	@Test
	public void whenTriangleExistThenAreaIsSet() {

		double expectedValue;
		double actualValue;

		Triangle triangle = new Triangle(new Point(1, 2), new Point(1, 4), new Point(3, 4));

		expectedValue = 2D;
		actualValue = triangle.area();

		assertThat(actualValue, closeTo(expectedValue, 0.01));

	}

}

@@ -540,55 +540,8 @@
  %7B%0A%0A
-%09%09double expectedValue;%0A%09%09double actualValue;%0A%0A
 %09%09Tr
@@ -622,24 +622,31 @@
 (2, 2));%0A%0A%09%09
+double 
 expectedValu
@@ -652,24 +652,31 @@
 ue = -1D;%0A%09%09
+double 
 actualValue 
@@ -865,55 +865,8 @@
  %7B%0A%0A
-%09%09double expectedValue;%0A%09%09double actualValue;%0A%0A
 %09%09Tr
@@ -951,16 +951,23 @@
 4));%0A%0A%09%09
+double 
 expected
@@ -980,16 +980,23 @@
 = 2D;%0A%09%09
+double 
 actualVa

Refactor TriangleTest.java