Injected the CategoryDao where needed.

This commit is contained in:
Paul Hawke 2018-01-04 21:45:44 -06:00
parent feb435304f
commit 1d3befcbd2
4 changed files with 35 additions and 19 deletions

View file

@ -50,20 +50,20 @@ import static org.mockito.Mockito.when;
public class CategoryDaoTest {
@Mock
ContentProviderClient client;
private ContentProviderClient client;
@Mock
SQLiteDatabase database;
private SQLiteDatabase database;
@Captor
ArgumentCaptor<ContentValues> captor;
private ArgumentCaptor<ContentValues> captor;
@Captor
ArgumentCaptor<String[]> queryCaptor;
private ArgumentCaptor<String[]> queryCaptor;
private CategoryDao testObject;
@Before
public void setUp() throws Exception {
MockitoAnnotations.initMocks(this);
testObject = new CategoryDao(client);
testObject = new CategoryDao(() -> client);
}
@Test