@@ -5,16 +5,19 @@ import jp.studyplus.android.sdk.record.StudyRecordAmountRange
5
5
import jp.studyplus.android.sdk.record.StudyRecordAmountTotal
6
6
import org.junit.Assert.assertEquals
7
7
import org.junit.Test
8
+ import org.junit.runner.RunWith
9
+ import org.robolectric.RobolectricTestRunner
8
10
import java.util.*
9
11
12
+ @RunWith(RobolectricTestRunner ::class )
10
13
class StudyRecordUnitTest {
11
14
12
15
@Test
13
16
fun toJsonTest_littleParams () {
14
17
val studyRecord = StudyRecord (2 * 60 )
15
18
16
19
assertEquals(
17
- " {\" duration \" :120, \" recorded_at\" :\" ${StudyRecord .formatTime(studyRecord.recordedTime)} \" }" ,
20
+ " {\" recorded_at\" :\" ${StudyRecord .formatTime(studyRecord.recordedTime)} \" , \" duration \" :120 }" ,
18
21
studyRecord.toJson()
19
22
)
20
23
}
@@ -29,7 +32,7 @@ class StudyRecordUnitTest {
29
32
)
30
33
31
34
assertEquals(
32
- " {\" duration \" :120, \" recorded_at\" :\" 2019-06-01 01:02:03\" ,\" amount \" :30 ,\" comment\" :\" perfect!\" }" ,
35
+ " {\" recorded_at\" :\" 2019-06-01 01:02:03\" ,\" duration \" :120 ,\" comment\" :\" perfect!\" , \" amount \" :30 }" ,
33
36
studyRecord.toJson()
34
37
)
35
38
}
@@ -44,7 +47,7 @@ class StudyRecordUnitTest {
44
47
)
45
48
46
49
assertEquals(
47
- " {\" duration \" :120, \" start_position \" :5, \" recorded_at\" :\" 2019-06-01 01:02:03\" ,\" comment\" :\" perfect!\" ,\" end_position\" :12}" ,
50
+ " {\" recorded_at\" :\" 2019-06-01 01:02:03\" ,\" duration \" :120, \" comment\" :\" perfect!\" , \" start_position \" :5 ,\" end_position\" :12}" ,
48
51
studyRecord.toJson()
49
52
)
50
53
}
0 commit comments