package pl.pkk82.filehierarchyassert;

import static org.assertj.core.api.BDDAssertions.then;

import java.util.List;

import com.google.common.collect.ImmutableList;

import org.junit.Test;

public class FileHierarchyAssertContainsFileWithContentInPathTest extends AbstractFileHiearchyAssertTest {


	@Test
	public void shouldSucceed() {
		givenFileHierarchyAssert();
		whenContainsFileInPath("file1", ImmutableList.<String>of());
		thenAssertionIsSucceeded();
	}


	@Test
	public void shouldSucceedWithOneLevelPath() {
		givenFileHierarchyAssert();
		whenContainsFileInPath("file11", ImmutableList.of("file11"), "dir1");
		thenAssertionIsSucceeded();
	}

	@Test
	public void shouldSucceedWithTwoLevelPath() {
		givenFileHierarchyAssert();
		whenContainsFileInPath("file212", ImmutableList.of("file212", "file212"), "dir2", "dir21");
		thenAssertionIsSucceeded();
	}

	@Test
	public void shouldFailWhenExpectedEmtpy() {
		givenFileHierarchyAssert();
		whenContainsFileInPath("file1", ImmutableList.of("line1"));
		thenAssertionIsFailed().hasMessage(String.format("\nExpecting:\n <%s>\n" +
				"to contain lines:\n <line1>,\n" +
				"but it contains:\n <no lines>\n", preparePath("file1")));
	}

	@Test
	public void shouldFailWhenExpectedNonEmtpy() {
		givenFileHierarchyAssert();
		whenContainsFileInPath("file11", ImmutableList.<String>of(), "dir1");
		thenAssertionIsFailed().hasMessage(String.format("\nExpecting:\n <%s>\n" +
				"to contain lines:\n <no lines>,\n" +
				"but it contains:\n <file11>\n", preparePath("dir1", "file11")));
	}

	private void whenContainsFileInPath(String fileName, List<String> content, String... dirPath) {
		try {
			fileHierarchyAssert.containsFileWithContentInPath(fileName, content, dirPath);
		} catch (AssertionError e) {
			throwableAssert = then(e);
		}
	}

}
@@ -372,32 +372,43 @@
 whenContainsFile
+WithContent
 InPath(%22file1%22, 
@@ -432,24 +432,24 @@
 ring%3Eof());%0A
-
 %09%09thenAssert
@@ -565,32 +565,43 @@
 whenContainsFile
+WithContent
 InPath(%22file11%22,
@@ -766,32 +766,43 @@
 whenContainsFile
+WithContent
 InPath(%22file212%22
@@ -987,32 +987,43 @@
 whenContainsFile
+WithContent
 InPath(%22file1%22, 
@@ -1332,24 +1332,35 @@
 ContainsFile
+WithContent
 InPath(%22file
@@ -1594,16 +1594,16 @@
 ));%0A%09%7D%0A%0A
-
 %09private
@@ -1624,16 +1624,27 @@
 ainsFile
+WithContent
 InPath(S

Correct method name.