Ejemplo n.º 1
0
 @Test
 public void loadTranslations_OnlyName() throws IOException {
   when(bufferedReaderMock.readLine()).thenReturn("DictionnaireTest");
   IDictionary dictionary = dictionaryParser.loadTranslations(bufferedReaderMock);
   assertThat(dictionary.getName(), is(equalTo("DictionnaireTest")));
   assertThat(dictionary.isEmpty(), is(equalTo(true)));
 }
Ejemplo n.º 2
0
 @Test
 public void loadTranslations_containsTranslation() throws IOException {
   when(bufferedReaderMock.readLine())
       .thenReturn("DictionnaireTest")
       .thenReturn("contre = against")
       .thenReturn("");
   IDictionary dictionary = dictionaryParser.loadTranslations(bufferedReaderMock);
   assertThat(dictionary.getName(), is(equalTo("DictionnaireTest")));
   assertThat(dictionary.getTranslation("contre"), hasItem("against"));
   assertThat(dictionary.isEmpty(), is(equalTo(false)));
 }
Ejemplo n.º 3
0
 @Test(expected = IOException.class)
 public void loadTranslations_noName() throws IOException {
   when(bufferedReaderMock.readLine()).thenReturn("contre = against").thenReturn("");
   IDictionary dictionary = dictionaryParser.loadTranslations(bufferedReaderMock);
 }