예제 #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)));
 }
예제 #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)));
 }