|
|
@ -1,29 +1,13 @@
|
|
|
|
package com.todoroo.astrid.gtasks;
|
|
|
|
package com.todoroo.astrid.gtasks;
|
|
|
|
|
|
|
|
|
|
|
|
import static com.natpryce.makeiteasy.MakeItEasy.with;
|
|
|
|
|
|
|
|
import static java.util.Arrays.asList;
|
|
|
|
|
|
|
|
import static java.util.Collections.singletonList;
|
|
|
|
|
|
|
|
import static junit.framework.Assert.assertEquals;
|
|
|
|
|
|
|
|
import static junit.framework.Assert.assertNull;
|
|
|
|
|
|
|
|
import static org.tasks.makers.GtaskListMaker.ID;
|
|
|
|
|
|
|
|
import static org.tasks.makers.GtaskListMaker.LAST_SYNC;
|
|
|
|
|
|
|
|
import static org.tasks.makers.GtaskListMaker.NAME;
|
|
|
|
|
|
|
|
import static org.tasks.makers.GtaskListMaker.REMOTE_ID;
|
|
|
|
|
|
|
|
import static org.tasks.makers.GtaskListMaker.newGtaskList;
|
|
|
|
|
|
|
|
import static org.tasks.makers.RemoteGtaskListMaker.newRemoteList;
|
|
|
|
|
|
|
|
import static org.tasks.time.DateTimeUtils.currentTimeMillis;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
import androidx.test.runner.AndroidJUnit4;
|
|
|
|
|
|
|
|
import com.google.api.client.util.DateTime;
|
|
|
|
import com.google.api.client.util.DateTime;
|
|
|
|
import com.google.api.services.tasks.model.TaskList;
|
|
|
|
import com.google.api.services.tasks.model.TaskList;
|
|
|
|
import com.todoroo.astrid.dao.TaskDao;
|
|
|
|
|
|
|
|
import com.todoroo.astrid.service.TaskDeleter;
|
|
|
|
import com.todoroo.astrid.service.TaskDeleter;
|
|
|
|
import javax.inject.Inject;
|
|
|
|
|
|
|
|
import org.junit.Test;
|
|
|
|
import org.junit.Test;
|
|
|
|
import org.junit.runner.RunWith;
|
|
|
|
import org.junit.runner.RunWith;
|
|
|
|
import org.tasks.LocalBroadcastManager;
|
|
|
|
import org.tasks.LocalBroadcastManager;
|
|
|
|
import org.tasks.data.GoogleTaskAccount;
|
|
|
|
import org.tasks.data.GoogleTaskAccount;
|
|
|
|
import org.tasks.data.GoogleTaskDao;
|
|
|
|
|
|
|
|
import org.tasks.data.GoogleTaskList;
|
|
|
|
import org.tasks.data.GoogleTaskList;
|
|
|
|
import org.tasks.data.GoogleTaskListDao;
|
|
|
|
import org.tasks.data.GoogleTaskListDao;
|
|
|
|
import org.tasks.injection.InjectingTestCase;
|
|
|
|
import org.tasks.injection.InjectingTestCase;
|
|
|
@ -31,13 +15,28 @@ import org.tasks.injection.TestComponent;
|
|
|
|
import org.tasks.jobs.WorkManager;
|
|
|
|
import org.tasks.jobs.WorkManager;
|
|
|
|
import org.tasks.makers.RemoteGtaskListMaker;
|
|
|
|
import org.tasks.makers.RemoteGtaskListMaker;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
import javax.inject.Inject;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
import androidx.test.runner.AndroidJUnit4;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
import static com.natpryce.makeiteasy.MakeItEasy.with;
|
|
|
|
|
|
|
|
import static java.util.Arrays.asList;
|
|
|
|
|
|
|
|
import static java.util.Collections.singletonList;
|
|
|
|
|
|
|
|
import static junit.framework.Assert.assertEquals;
|
|
|
|
|
|
|
|
import static junit.framework.Assert.assertNull;
|
|
|
|
|
|
|
|
import static org.tasks.makers.GtaskListMaker.ID;
|
|
|
|
|
|
|
|
import static org.tasks.makers.GtaskListMaker.LAST_SYNC;
|
|
|
|
|
|
|
|
import static org.tasks.makers.GtaskListMaker.NAME;
|
|
|
|
|
|
|
|
import static org.tasks.makers.GtaskListMaker.REMOTE_ID;
|
|
|
|
|
|
|
|
import static org.tasks.makers.GtaskListMaker.newGtaskList;
|
|
|
|
|
|
|
|
import static org.tasks.makers.RemoteGtaskListMaker.newRemoteList;
|
|
|
|
|
|
|
|
import static org.tasks.time.DateTimeUtils.currentTimeMillis;
|
|
|
|
|
|
|
|
|
|
|
|
@RunWith(AndroidJUnit4.class)
|
|
|
|
@RunWith(AndroidJUnit4.class)
|
|
|
|
public class GtasksListServiceTest extends InjectingTestCase {
|
|
|
|
public class GtasksListServiceTest extends InjectingTestCase {
|
|
|
|
|
|
|
|
|
|
|
|
@Inject TaskDeleter taskDeleter;
|
|
|
|
@Inject TaskDeleter taskDeleter;
|
|
|
|
@Inject LocalBroadcastManager localBroadcastManager;
|
|
|
|
@Inject LocalBroadcastManager localBroadcastManager;
|
|
|
|
@Inject GoogleTaskDao googleTaskDao;
|
|
|
|
|
|
|
|
@Inject TaskDao taskDao;
|
|
|
|
|
|
|
|
@Inject WorkManager workManager;
|
|
|
|
@Inject WorkManager workManager;
|
|
|
|
|
|
|
|
|
|
|
|
@Inject GoogleTaskListDao googleTaskListDao;
|
|
|
|
@Inject GoogleTaskListDao googleTaskListDao;
|
|
|
@ -49,7 +48,7 @@ public class GtasksListServiceTest extends InjectingTestCase {
|
|
|
|
workManager.init();
|
|
|
|
workManager.init();
|
|
|
|
gtasksListService =
|
|
|
|
gtasksListService =
|
|
|
|
new GtasksListService(
|
|
|
|
new GtasksListService(
|
|
|
|
googleTaskListDao, taskDeleter, localBroadcastManager, googleTaskDao, taskDao);
|
|
|
|
googleTaskListDao, taskDeleter, localBroadcastManager);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
@Override
|
|
|
|