Пример #1
0
 @Test
 public void readFile_shouldReadAllLinesFromTheGivenFile() throws Exception {
   assertThat(cut.readFile("src/test/java/.test"), is(testRawFileLines()));
 }
Пример #2
0
 @Test(expected = IllegalArgumentException.class)
 public void readFile_shouldThrowIllegalArgumentExceptionWhenFileDoesNotExist() throws Exception {
   cut.readFile("not/a/real/.file");
 }
Пример #3
0
 @Test
 public void readFile_shouldIgnoreLeadingAndTrailingWhitespaceInFilenameParameter()
     throws Exception {
   assertThat(cut.readFile(" src/test/java/.test "), is(testRawFileLines()));
 }
Пример #4
0
 @Test(expected = IllegalArgumentException.class)
 public void readFile_shouldFailWhenPassedAStringContainingOnlyWhitespace() throws Exception {
   cut.readFile(" ");
 }
Пример #5
0
 @Test(expected = IllegalArgumentException.class)
 public void readFile_shouldFailWhenPassedAnEmptyString() throws Exception {
   cut.readFile("");
 }
Пример #6
0
 @Test(expected = IllegalArgumentException.class)
 public void readFile_shouldFailWhenPassedNull() throws Exception {
   cut.readFile(null);
 }