package ru.job4j.loop;

import org.junit.Test;
import java.util.StringJoiner;

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

/**
* Test
* @author <a href="mailto:shynybaev@gmail.com">Assan Shynybayev</a>
* @version 1.0
* @since 0.1
*/

public class PaintTest{
	@Test
	public void whenPyramidRight(){
		Paint paint = new Paint();
		String res = paint.rightTrl(4);
		System.out.println(res);
		assertThat(res, is(
				new StringJoiner(System.lineSeparator(), "", System.lineSeparator())
						.add("^   ")
						.add("^^  ")
						.add("^^^ ")
						.add("^^^^")
						.toString()
				)
			);
		}
	

	@Test
	public void whenPyramidLeft(){
		Paint paint = new Paint();
		String res = paint.leftTrl(4);
		System.out.println(res);
		assertThat(res, is(
				new StringJoiner(System.lineSeparator(), "", System.lineSeparator())
						.add("   ^")
						.add("  ^^")
						.add(" ^^^")
						.add("^^^^")
						.toString()
		));
	}
}
@@ -290,16 +290,402 @@
 ntTest%7B%0A
+%09@Test%0A%09public void whenPyramidMain()%7B%0A%09%09Paint paint = new Paint();%0A%09%09String res = paint.pyramid(4);%0A%09%09System.out.println(res);%0A%09%09assertThat(res, is(%0A%09%09%09%09new StringJoiner(System.lineSeparator(), %22%22, System.lineSeparator())%0A%09%09%09%09%09%09.add(%22   %5E   %22)%0A%09%09%09%09%09%09.add(%22  %5E%5E%5E  %22)%0A%09%09%09%09%09%09.add(%22 %5E%5E%5E%5E%5E %22)%0A                        .add(%22%5E%5E%5E%5E%5E%5E%5E%22)%0A                        .toString()%0A%09%09%09)%0A        );%0A%09%7D%0A%0A%0A
 %09@Test%0A%09

add pyramid test