mirror of https://github.com/tasks/tasks
You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
35 lines
753 B
Java
35 lines
753 B
Java
/**
|
|
* Copyright (c) 2012 Todoroo Inc
|
|
*
|
|
* See the file "LICENSE" for the full license governing this code.
|
|
*/
|
|
package com.todoroo.astrid.test;
|
|
|
|
import com.todoroo.astrid.dao.Database;
|
|
|
|
import org.junit.After;
|
|
import org.tasks.injection.InjectingTestCase;
|
|
|
|
import static android.support.test.InstrumentationRegistry.getTargetContext;
|
|
|
|
public abstract class DatabaseTestCase extends InjectingTestCase {
|
|
|
|
protected Database database;
|
|
|
|
@Override
|
|
public void setUp() {
|
|
super.setUp();
|
|
|
|
database = component.getDatabase();
|
|
|
|
database.close();
|
|
getTargetContext().deleteDatabase(database.getName());
|
|
database.openForWriting();
|
|
}
|
|
|
|
@After
|
|
public void tearDown() {
|
|
database.close();
|
|
}
|
|
}
|