@@ -0,0 +1,1647 @@
+package org.msf.records.ui.chart;%0A%0Aimport android.test.AndroidTestCase;%0A%0Aimport org.mockito.Mock;%0Aimport org.mockito.MockitoAnnotations;%0Aimport org.msf.records.data.app.AppModel;%0Aimport org.msf.records.events.CrudEventBus;%0Aimport org.msf.records.net.OpenMrsChartServer;%0Aimport org.msf.records.ui.FakeEventBus;%0Aimport org.msf.records.ui.chart.PatientChartController.ObservationsProvider;%0Aimport org.msf.records.ui.chart.PatientChartController.OdkResultSender;%0A%0A/**%0A * Tests for %7B@link PatientChartController%7D.%0A */%0Apublic class PatientChartControllerTest extends AndroidTestCase %7B%0A%0A%09private PatientChartController mController;%0A%09@Mock private AppModel mMockAppModel;%0A%09@Mock private OpenMrsChartServer mMockServer;%0A%09@Mock private CrudEventBus mMockCrudEventBus; // TODO: replace with a fake%0A%09@Mock private PatientChartController.Ui mMockUi;%0A%09@Mock private OdkResultSender mMockOdkResultSender;%0A%09@Mock private ObservationsProvider mMockObservationsProvider;%0A%09private FakeEventBus mFakeEventBus;%0A%0A%09@Override%0A%09protected void setUp() throws Exception %7B%0A%09%09super.setUp();%0A%09%09MockitoAnnotations.initMocks(this);%0A%0A%09%09mFakeEventBus = new FakeEventBus();%0A%0A%09%09mController = new PatientChartController(%0A%09%09%09%09mMockAppModel,%0A%09%09%09%09mMockServer,%0A%09%09%09%09mFakeEventBus,%0A%09%09%09%09mMockCrudEventBus,%0A%09%09%09%09mMockUi,%0A%09%09%09%09mMockOdkResultSender,%0A%09%09%09%09mMockObservationsProvider,%0A%09%09%09%09null);%0A%09%7D%0A%0A%0A%09public void testSuspend_UnregistersFromEventBus() %7B%0A%09%09// GIVEN an initialized controller%0A%09%09mController.init();%0A%09%09// WHEN the controller is suspended%0A%09%09mController.suspend();%0A%09%09// THEN the controller unregisters from the event bus%0A%09%09assertEquals(0, mFakeEventBus.countRegisteredReceivers());%0A%09%7D%0A%0A%7D%0A%0A

Add a unit test for PatientChartController.