@Test public void testShowMessageString() { int calculated = adapter.getItemCount() + 1; chatActivity.showMessage("Test that ***."); int after = adapter.getItemCount(); assertEquals(calculated, after); }
@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); }
@Test public void testUpdateDataSet() throws IllegalAccessException, NoSuchFieldException { chatActivity.onResume(); chatActivity.showMessage("test"); assertTrue(recyclerView.hasPendingAdapterUpdates()); chatActivity.updateDataSet(); // assertFalse(recyclerView.hasPendingAdapterUpdates()); chatActivity.onStop(); }