示例#1
0
 @Test
 public void testShowMessageString() {
   int calculated = adapter.getItemCount() + 1;
   chatActivity.showMessage("Test that ***.");
   int after = adapter.getItemCount();
   assertEquals(calculated, after);
 }
示例#2
0
 @Test
 public void testShowMessageFile() throws IOException {
   int calculated = adapter.getItemCount() + 1;
   File file = File.createTempFile("Test that ***.", ".jpeg", context.getFilesDir());
   chatActivity.showMessage(file);
   int after = adapter.getItemCount();
   assertEquals(calculated, after);
 }
示例#3
0
 @Test
 public void testShowDataList() throws IOException, NoSuchFieldException, IllegalAccessException {
   int before = adapter.getItemCount();
   chatActivity.showDataList(null);
   Field field = ChatRecyclerAdapter.class.getDeclaredField("mDataList");
   field.setAccessible(true);
   List<Data> dataList = (List<Data>) field.get(adapter);
   assertNull(dataList);
   chatActivity.showDataList(chat.getDataObjects());
   dataList = (List<Data>) field.get(adapter);
   assertTrue(dataList != null);
   int after = adapter.getItemCount();
   assertEquals(before, after);
 }