Creation date is UTC

gtask_related_email
Alex Baker 5 years ago
parent 524e2573f2
commit 4e0c009d5e

@ -5,6 +5,8 @@ import static org.tasks.injection.TestModule.newPreferences;
import android.content.Context; import android.content.Context;
import androidx.test.core.app.ApplicationProvider; import androidx.test.core.app.ApplicationProvider;
import androidx.test.ext.junit.runners.AndroidJUnit4; import androidx.test.ext.junit.runners.AndroidJUnit4;
import java.security.KeyManagementException;
import java.security.NoSuchAlgorithmException;
import org.junit.Test; import org.junit.Test;
import org.junit.runner.RunWith; import org.junit.runner.RunWith;
@ -12,7 +14,7 @@ import org.junit.runner.RunWith;
public class CaldavClientTest { public class CaldavClientTest {
@Test @Test
public void dontCrashOnSpaceInUrl() { public void dontCrashOnSpaceInUrl() throws NoSuchAlgorithmException, KeyManagementException {
Context context = ApplicationProvider.getApplicationContext(); Context context = ApplicationProvider.getApplicationContext();
new CaldavClient(context, null, newPreferences(context), null) new CaldavClient(context, null, newPreferences(context), null)
.forUrl("https://example.com/remote.php/a space/", "username", "password"); .forUrl("https://example.com/remote.php/a space/", "username", "password");

@ -40,7 +40,7 @@ public class NextCloudTests {
@Test @Test
public void readCreationDate() { public void readCreationDate() {
assertEquals( assertEquals(
new DateTime(2018, 4, 17, 16, 32, 3).getMillis(), new DateTime(2018, 4, 17, 11, 32, 3).getMillis(),
(long) vtodo("nextcloud/basic_no_due_date.txt").getCreationDate()); (long) vtodo("nextcloud/basic_no_due_date.txt").getCreationDate());
} }

@ -111,7 +111,7 @@ public class GoogleTaskDaoTests extends InjectingTestCase {
googleTaskDao.insertAndShift(newGoogleTask(with(REMOTE_ID, "2")), false); googleTaskDao.insertAndShift(newGoogleTask(with(REMOTE_ID, "2")), false);
googleTaskDao.insertAndShift(newGoogleTask(with(REMOTE_ID, "3")), false); googleTaskDao.insertAndShift(newGoogleTask(with(REMOTE_ID, "3")), false);
GoogleTask two = googleTaskDao.getByRemoteId("2"); SubsetGoogleTask two = getByRemoteId("2");
googleTaskDao.move(two, 0, 0); googleTaskDao.move(two, 0, 0);
@ -126,7 +126,7 @@ public class GoogleTaskDaoTests extends InjectingTestCase {
googleTaskDao.insertAndShift(newGoogleTask(with(REMOTE_ID, "2")), false); googleTaskDao.insertAndShift(newGoogleTask(with(REMOTE_ID, "2")), false);
googleTaskDao.insertAndShift(newGoogleTask(with(REMOTE_ID, "3")), false); googleTaskDao.insertAndShift(newGoogleTask(with(REMOTE_ID, "3")), false);
GoogleTask one = googleTaskDao.getByRemoteId("1"); SubsetGoogleTask one = getByRemoteId("1");
googleTaskDao.move(one, 0, 1); googleTaskDao.move(one, 0, 1);
@ -141,7 +141,7 @@ public class GoogleTaskDaoTests extends InjectingTestCase {
googleTaskDao.insertAndShift(newGoogleTask(with(REMOTE_ID, "2")), false); googleTaskDao.insertAndShift(newGoogleTask(with(REMOTE_ID, "2")), false);
googleTaskDao.insertAndShift(newGoogleTask(with(REMOTE_ID, "3")), false); googleTaskDao.insertAndShift(newGoogleTask(with(REMOTE_ID, "3")), false);
GoogleTask three = googleTaskDao.getByRemoteId("3"); SubsetGoogleTask three = getByRemoteId("3");
googleTaskDao.move(three, 0, 0); googleTaskDao.move(three, 0, 0);
@ -156,7 +156,7 @@ public class GoogleTaskDaoTests extends InjectingTestCase {
googleTaskDao.insertAndShift(newGoogleTask(with(REMOTE_ID, "2")), false); googleTaskDao.insertAndShift(newGoogleTask(with(REMOTE_ID, "2")), false);
googleTaskDao.insertAndShift(newGoogleTask(with(REMOTE_ID, "3")), false); googleTaskDao.insertAndShift(newGoogleTask(with(REMOTE_ID, "3")), false);
GoogleTask one = googleTaskDao.getByRemoteId("1"); SubsetGoogleTask one = getByRemoteId("1");
googleTaskDao.move(one, 0, 2); googleTaskDao.move(one, 0, 2);
@ -180,6 +180,16 @@ public class GoogleTaskDaoTests extends InjectingTestCase {
googleTaskDao.insertAndShift(googleTask, top); googleTaskDao.insertAndShift(googleTask, top);
} }
private SubsetGoogleTask getByRemoteId(String remoteId) {
GoogleTask googleTask = googleTaskDao.getByRemoteId(remoteId);
SubsetGoogleTask result = new SubsetGoogleTask();
result.gt_id = googleTask.getId();
result.gt_list_id = googleTask.getListId();
result.gt_order = googleTask.getOrder();
result.gt_parent = googleTask.getParent();
return result;
}
@Override @Override
protected void inject(TestComponent component) { protected void inject(TestComponent component) {
component.inject(this); component.inject(this);

Loading…
Cancel
Save