package ru.job4j.piramid;

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

/**
* PiramidTest class.
* @author Yury Chuksin (chuksin.yury@gmail.com)
* @since 24.01.2017
*/
public class PiramidTest {

	/**
	* string1 1st test string.
	*/
	private final String string1 = "    ^    ";

	/**
	* string2 2nd test string.
	*/
	private final String string2 = "   ^^^   ";

	/**
	* string3 3rd test string.
	*/
	private final String string3 = "  ^ ^ ^  ";

	/**
	* string4 4th test string.
	*/
	private final String string4 = " ^  ^  ^ ";

	/**
	* string5 5th test string.
	*/
	private final String string5 = "^^^^^^^^^";

	/**
	* sr line separator.
	*/
	private final String sr = System.getProperty("line.separator");

	/**
	* string1 1st test string.
	*/
	private final String stringTest = String.format("%s\r\n%s\r\n%s\r\n%s\r\n%s\r\n", string1, string2, string3, string4, string5);

	/**
	* Making empty object Piramid.
	*/
	private Piramid piramid = new Piramid();

	/**
	* WhenDoBuildPiramidThenPrintsPiramid cheks is that method prints piramid in pseudographic.
	*/
	@Test
	public void whenDoBuildPiramidThenPrintsPiramid() {
		assertThat(stringTest, is(this.piramid.buildPiramid(5)));
	}
}
@@ -855,36 +855,26 @@
 (%22%25s
-%5Cr%5Cn%25s%5Cr%5Cn%25s%5Cr%5Cn%25s%5Cr%5Cn%25s%5Cr%5Cn
+%25s%25s%25s%25s%25s%25s%25s%25s%25s
 %22, s
@@ -880,16 +880,20 @@
 string1,
+ sr,
  string2
@@ -893,16 +893,20 @@
 string2,
+ sr,
  string3
@@ -906,16 +906,20 @@
 string3,
+ sr,
  string4
@@ -919,24 +919,28 @@
 string4,
+ sr,
  string5
 );%0A%0A%09/**
@@ -931,16 +931,20 @@
  string5
+, sr
 );%0A%0A%09/**

Task 4.3. last corrections