Fixing CSVExport, CSVWrite tests

pull/1890/head
foralost 2 years ago
parent 87f51d854a
commit 5b291b9a7a

@ -1,10 +1,10 @@
2015-01-25,2 2015-01-25,YES_MANUAL
2015-01-24,0 2015-01-24,NO
2015-01-23,1 2015-01-23,YES_AUTO
2015-01-22,2 2015-01-22,YES_MANUAL
2015-01-21,2 2015-01-21,YES_MANUAL
2015-01-20,2 2015-01-20,YES_MANUAL
2015-01-19,1 2015-01-19,YES_AUTO
2015-01-18,1 2015-01-18,YES_AUTO
2015-01-17,2 2015-01-17,YES_MANUAL
2015-01-16,2 2015-01-16,YES_MANUAL

1 2015-01-25 2 YES_MANUAL
2 2015-01-24 0 NO
3 2015-01-23 1 YES_AUTO
4 2015-01-22 2 YES_MANUAL
5 2015-01-21 2 YES_MANUAL
6 2015-01-20 2 YES_MANUAL
7 2015-01-19 1 YES_AUTO
8 2015-01-18 1 YES_AUTO
9 2015-01-17 2 YES_MANUAL
10 2015-01-16 2 YES_MANUAL

@ -1,11 +1,11 @@
Date,Meditate,Wake up early, Date,Meditate,Wake up early,
2015-01-25,-1,2, 2015-01-25,UNKNOWN,YES_MANUAL,
2015-01-24,-1,0, 2015-01-24,UNKNOWN,NO,
2015-01-23,-1,1, 2015-01-23,UNKNOWN,YES_AUTO,
2015-01-22,-1,2, 2015-01-22,UNKNOWN,YES_MANUAL,
2015-01-21,-1,2, 2015-01-21,UNKNOWN,YES_MANUAL,
2015-01-20,-1,2, 2015-01-20,UNKNOWN,YES_MANUAL,
2015-01-19,-1,1, 2015-01-19,UNKNOWN,YES_AUTO,
2015-01-18,-1,1, 2015-01-18,UNKNOWN,YES_AUTO,
2015-01-17,-1,2, 2015-01-17,UNKNOWN,YES_MANUAL,
2015-01-16,-1,2, 2015-01-16,UNKNOWN,YES_MANUAL,

1 Date Meditate Wake up early
2 2015-01-25 -1 UNKNOWN 2 YES_MANUAL
3 2015-01-24 -1 UNKNOWN 0 NO
4 2015-01-23 -1 UNKNOWN 1 YES_AUTO
5 2015-01-22 -1 UNKNOWN 2 YES_MANUAL
6 2015-01-21 -1 UNKNOWN 2 YES_MANUAL
7 2015-01-20 -1 UNKNOWN 2 YES_MANUAL
8 2015-01-19 -1 UNKNOWN 1 YES_AUTO
9 2015-01-18 -1 UNKNOWN 1 YES_AUTO
10 2015-01-17 -1 UNKNOWN 2 YES_MANUAL
11 2015-01-16 -1 UNKNOWN 2 YES_MANUAL

@ -1,3 +1,3 @@
Position,Name,Question,Description,NumRepetitions,Interval,Color Position,Name,Question,Description,NumRepetitions,Interval,Color,Unit,Target Type,Target Value
001,Meditate,Did you meditate this morning?,,1,1,#FF8F00 001,Meditate,Did you meditate this morning?,,1,1,#FF8F00,,AT_LEAST,0.0
002,Wake up early,Did you wake up before 6am?,,2,3,#00897B 002,Wake up early,Did you wake up before 6am?,,2,3,#00897B,,AT_LEAST,0.0

1 Position Name Question Description NumRepetitions Interval Color Unit Target Type Target Value
2 001 Meditate Did you meditate this morning? 1 1 #FF8F00 AT_LEAST 0.0
3 002 Wake up early Did you wake up before 6am? 2 3 #00897B AT_LEAST 0.0

@ -112,6 +112,9 @@ class HabitsCSVExporterTest : BaseUnitTest() {
file.deleteOnExit() file.deleteOnExit()
copyAssetToFile(assetFilename, file) copyAssetToFile(assetFilename, file)
println(file.path)
println(assetFilename)
assertTrue( assertTrue(
FileUtils.contentEquals( FileUtils.contentEquals(
file, file,

@ -206,9 +206,9 @@ class HabitListTest : BaseUnitTest() {
list.add(h2) list.add(h2)
val expectedCSV = val expectedCSV =
""" """
Position,Name,Question,Description,NumRepetitions,Interval,Color Position,Name,Question,Description,NumRepetitions,Interval,Color,Unit,Target Type,Target Value
001,Meditate,Did you meditate this morning?,this is a test description,1,1,#FF8F00 001,Meditate,Did you meditate this morning?,this is a test description,1,1,#FF8F00,,AT_LEAST,0.0
002,Wake up early,Did you wake up before 6am?,,2,3,#AFB42B 002,Wake up early,Did you wake up before 6am?,,2,3,#AFB42B,,AT_LEAST,0.0
""".trimIndent() """.trimIndent()
val writer = StringWriter() val writer = StringWriter()

Loading…
Cancel
Save