Skip to content

Commit

Permalink
@saleem: added a second test in UnicodeFileToHtmlTextConverterTest. N…
Browse files Browse the repository at this point in the history
…o changes to UnicodeFileToHtmlTextConverter
  • Loading branch information
saleem committed Oct 19, 2013
1 parent 6fddaf2 commit c7f7fd8
Showing 1 changed file with 13 additions and 3 deletions.
Expand Up @@ -17,19 +17,29 @@ public class UnicodeFileToHtmlTextConverterTest {
@Before
public void setUp() throws Exception {
tempInputFile = File.createTempFile(FILE_NAME, FILE_EXT);
BufferedWriter out = new BufferedWriter(new FileWriter(tempInputFile));
out.write("Hello World");
out.close();
}

@After
public void tearDown() throws Exception {
tempInputFile.delete();
}

private void writeToTempInputFile(String contents) throws Exception {
BufferedWriter out = new BufferedWriter(new FileWriter(tempInputFile));
out.write(contents);
out.close();
}

@Test
public void convertAppendsLineBreakTagToEndOfSimpleOneLine() throws Exception {
writeToTempInputFile("Hello World");
UnicodeFileToHtmlTextConverter converter = new UnicodeFileToHtmlTextConverter(tempInputFile.getAbsolutePath());
assertThat(converter.convertToHtml(), is("Hello World<br />"));
}

@Test
public void converterReturnsEmptyStringForEmptyFile() throws Exception {
UnicodeFileToHtmlTextConverter converter = new UnicodeFileToHtmlTextConverter(tempInputFile.getAbsolutePath());
assertThat(converter.convertToHtml(), is(""));
}
}

0 comments on commit c7f7fd8

Please sign in to comment.