|
|
|
@ -3,8 +3,10 @@ package org.tasks.sync.microsoft
|
|
|
|
|
import com.natpryce.makeiteasy.MakeItEasy
|
|
|
|
|
import com.todoroo.astrid.data.Task
|
|
|
|
|
import org.junit.Assert
|
|
|
|
|
import org.junit.Assert.assertEquals
|
|
|
|
|
import org.junit.Test
|
|
|
|
|
import org.tasks.TestUtilities
|
|
|
|
|
import org.tasks.TestUtilities.withTZ
|
|
|
|
|
import org.tasks.makers.TaskMaker
|
|
|
|
|
import org.tasks.time.DateTime
|
|
|
|
|
|
|
|
|
@ -12,7 +14,7 @@ class ConvertFromMicrosoftTests {
|
|
|
|
|
@Test
|
|
|
|
|
fun titleFromRemote() {
|
|
|
|
|
val (local, _) = TestUtilities.mstodo("microsoft/basic_task.txt")
|
|
|
|
|
Assert.assertEquals("Basic task", local.title)
|
|
|
|
|
assertEquals("Basic task", local.title)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Test
|
|
|
|
@ -28,7 +30,7 @@ class ConvertFromMicrosoftTests {
|
|
|
|
|
task = TaskMaker.newTask(MakeItEasy.with(TaskMaker.PRIORITY, Task.Priority.MEDIUM)),
|
|
|
|
|
defaultPriority = Task.Priority.LOW
|
|
|
|
|
)
|
|
|
|
|
Assert.assertEquals(Task.Priority.MEDIUM, local.priority)
|
|
|
|
|
assertEquals(Task.Priority.MEDIUM, local.priority)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Test
|
|
|
|
@ -38,7 +40,7 @@ class ConvertFromMicrosoftTests {
|
|
|
|
|
task = TaskMaker.newTask(MakeItEasy.with(TaskMaker.PRIORITY, Task.Priority.HIGH)),
|
|
|
|
|
defaultPriority = Task.Priority.LOW
|
|
|
|
|
)
|
|
|
|
|
Assert.assertEquals(Task.Priority.LOW, local.priority)
|
|
|
|
|
assertEquals(Task.Priority.LOW, local.priority)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Test
|
|
|
|
@ -48,18 +50,20 @@ class ConvertFromMicrosoftTests {
|
|
|
|
|
task = TaskMaker.newTask(MakeItEasy.with(TaskMaker.PRIORITY, Task.Priority.HIGH)),
|
|
|
|
|
defaultPriority = Task.Priority.HIGH
|
|
|
|
|
)
|
|
|
|
|
Assert.assertEquals(Task.Priority.NONE, local.priority)
|
|
|
|
|
assertEquals(Task.Priority.NONE, local.priority)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Test
|
|
|
|
|
fun noCompletionDate() {
|
|
|
|
|
val (local, _) = TestUtilities.mstodo("microsoft/basic_task.txt")
|
|
|
|
|
Assert.assertEquals(0, local.completionDate)
|
|
|
|
|
assertEquals(0, local.completionDate)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Test
|
|
|
|
|
fun parseCompletionDate() {
|
|
|
|
|
val (local, _) = TestUtilities.mstodo("microsoft/completed_task.txt")
|
|
|
|
|
Assert.assertEquals(DateTime(2022, 9, 18, 0, 0).millis, local.completionDate)
|
|
|
|
|
withTZ("America/Chicago") {
|
|
|
|
|
assertEquals(DateTime(2022, 9, 18, 0, 0).millis, local.completionDate)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|