diff --git a/opensrp-chw-core/src/test/java/org/smartregister/chw/core/fragment/CoreAllClientsRegisterFragmentTest.java b/opensrp-chw-core/src/test/java/org/smartregister/chw/core/fragment/CoreAllClientsRegisterFragmentTest.java new file mode 100644 index 0000000000..fba800cbf1 --- /dev/null +++ b/opensrp-chw-core/src/test/java/org/smartregister/chw/core/fragment/CoreAllClientsRegisterFragmentTest.java @@ -0,0 +1,41 @@ +package org.smartregister.chw.core.fragment; + + +import org.junit.Assert; +import org.junit.Before; +import org.junit.Test; +import org.mockito.Mock; +import org.mockito.Mockito; +import org.mockito.MockitoAnnotations; +import org.robolectric.util.ReflectionHelpers; +import org.smartregister.chw.core.BaseUnitTest; +import org.smartregister.chw.core.R; +import org.smartregister.chw.core.presenter.CoreAllClientsRegisterFragmentPresenter; + +public class CoreAllClientsRegisterFragmentTest extends BaseUnitTest { + + + @Mock + private CoreAllClientsRegisterFragmentPresenter presenter; + + private CoreAllClientsRegisterFragment fragment; + + @Before + public void setUp() { + MockitoAnnotations.initMocks(this); + fragment = Mockito.mock(CoreAllClientsRegisterFragment.class, Mockito.CALLS_REAL_METHODS); + ReflectionHelpers.setField(fragment, "presenter", presenter); + } + + @Test + public void presenterInitializesCorrectly() { + fragment.initializePresenter(); + Assert.assertNotNull(presenter); + } + + @Test + public void testGetToolbarTitle() { + int title = fragment.getToolBarTitle(); + Assert.assertEquals(R.string.menu_all_clients, title); + } +}