Skip to content

Commit

Permalink
Increase code coverage
Browse files Browse the repository at this point in the history
  • Loading branch information
hamza-vd committed Feb 23, 2023
1 parent 0052fa0 commit 414010f
Showing 1 changed file with 31 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
package org.smartregister.child.provider;

import static org.mockito.ArgumentMatchers.any;
import static org.mockito.ArgumentMatchers.anyInt;
import static org.mockito.ArgumentMatchers.eq;
import static org.mockito.Mockito.doReturn;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.times;
import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.when;

import android.view.LayoutInflater;
import android.view.View;

import org.junit.Test;
import org.smartregister.child.BaseUnitTest;
import org.smartregister.child.R;

public class AdvancedSearchClientsProviderTest extends BaseUnitTest {

@Test
public void testInflateLayoutForCursorAdapterInflatesCorrectView() {
AdvancedSearchClientsProvider provider = mock(AdvancedSearchClientsProvider.class);
LayoutInflater inflater = mock(LayoutInflater.class);
doReturn(inflater).when(provider).inflater();
when(provider.inflatelayoutForCursorAdapter()).thenCallRealMethod();
provider.inflatelayoutForCursorAdapter();
verify(inflater).inflate(eq(R.layout.advanced_search_client), any());
}

}

0 comments on commit 414010f

Please sign in to comment.