コード例 #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)));
 }
コード例 #3
0
 @Test(expected = IOException.class)
 public void loadTranslations_noName() throws IOException {
   when(bufferedReaderMock.readLine()).thenReturn("contre = against").thenReturn("");
   IDictionary dictionary = dictionaryParser.loadTranslations(bufferedReaderMock);
 }