From 888e1da3ae4f1d1c19ff428324e99ee957d99ff3 Mon Sep 17 00:00:00 2001 From: Hamza Ahmed Khan Date: Thu, 27 Apr 2023 13:12:50 +0500 Subject: [PATCH] Increase coverage --- .../AppTaskingLibraryConfigurationTest.java | 55 +++++++++++++++++++ 1 file changed, 55 insertions(+) diff --git a/opensrp-eusm/src/test/java/org/smartregister/eusm/config/AppTaskingLibraryConfigurationTest.java b/opensrp-eusm/src/test/java/org/smartregister/eusm/config/AppTaskingLibraryConfigurationTest.java index 5a449c0..f6af91b 100644 --- a/opensrp-eusm/src/test/java/org/smartregister/eusm/config/AppTaskingLibraryConfigurationTest.java +++ b/opensrp-eusm/src/test/java/org/smartregister/eusm/config/AppTaskingLibraryConfigurationTest.java @@ -24,12 +24,16 @@ import java.util.List; import static android.os.Looper.getMainLooper; +import static org.junit.Assert.assertArrayEquals; +import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertFalse; import static org.junit.Assert.assertNotNull; import static org.junit.Assert.assertNull; import static org.junit.Assert.assertTrue; import static org.mockito.ArgumentMatchers.any; +import static org.mockito.ArgumentMatchers.anyBoolean; import static org.mockito.ArgumentMatchers.anySet; +import static org.mockito.ArgumentMatchers.anyString; import static org.mockito.Mockito.doReturn; import static org.mockito.Mockito.mock; import static org.mockito.Mockito.spy; @@ -151,4 +155,55 @@ public void testProcessServerConfigsShouldPopulateServerConfigsIfSettingPresent( assertFalse(EusmApplication.getInstance().getServerConfigs().isEmpty()); } + + @Test + public void testGetResolveLocationTimeoutInSecondsShouldReturnZero() { + assertEquals(0, appTaskingLibraryConfiguration.getResolveLocationTimeoutInSeconds()); + } + + @Test + public void testIsFocusInvestigationShouldReturnFalse() { + assertFalse(appTaskingLibraryConfiguration.isFocusInvestigation()); + } + + @Test + public void testIsMDAShouldReturnFalse() { + assertFalse(appTaskingLibraryConfiguration.isMDA()); + } + + @Test + public void testDisplayDistanceScaleShouldReturnFalse() { + assertFalse(appTaskingLibraryConfiguration.displayDistanceScale()); + } + + @Test + public void testResetTaskInfoShouldReturnFalse() { + assertFalse(appTaskingLibraryConfiguration.resetTaskInfo(any(), any())); + } + + @Test + public void testArchiveClientShouldReturnFalse() { + assertFalse(appTaskingLibraryConfiguration.archiveClient(anyString(), anyBoolean())); + } + + @Test + public void testTaskRegisterMainColumnsSHouldReturnEmptyStringArray() { + assertArrayEquals(new String[0], appTaskingLibraryConfiguration.taskRegisterMainColumns(anyString())); + } + + @Test + public void testCalculateBusinessStatusShouldReturnNull() { + assertNull(appTaskingLibraryConfiguration.calculateBusinessStatus(any())); + } + + @Test + public void testIsMyLocationComponentEnabledShouldReturnTrue() { + assertTrue(appTaskingLibraryConfiguration.isMyLocationComponentEnabled()); + } + + @Test + public void testGetCurrentPlanIdShouldReturnNull() { + assertNull(appTaskingLibraryConfiguration.getCurrentPlanId()); + } + } \ No newline at end of file