|
|
@ -27,7 +27,6 @@ import nl.jqno.equalsverifier.*;
|
|
|
|
|
|
|
|
|
|
|
|
import static org.hamcrest.CoreMatchers.*;
|
|
|
|
import static org.hamcrest.CoreMatchers.*;
|
|
|
|
import static org.isoron.uhabits.core.utils.DateUtils.*;
|
|
|
|
import static org.isoron.uhabits.core.utils.DateUtils.*;
|
|
|
|
import static org.isoron.uhabits.core.utils.StringUtils.removePointers;
|
|
|
|
|
|
|
|
import static org.junit.Assert.*;
|
|
|
|
import static org.junit.Assert.*;
|
|
|
|
|
|
|
|
|
|
|
|
public class HabitTest extends BaseUnitTest
|
|
|
|
public class HabitTest extends BaseUnitTest
|
|
|
@ -150,22 +149,14 @@ public class HabitTest extends BaseUnitTest
|
|
|
|
{
|
|
|
|
{
|
|
|
|
Habit h = modelFactory.buildHabit();
|
|
|
|
Habit h = modelFactory.buildHabit();
|
|
|
|
h.setReminder(new Reminder(22, 30, WeekdayList.EVERY_DAY));
|
|
|
|
h.setReminder(new Reminder(22, 30, WeekdayList.EVERY_DAY));
|
|
|
|
|
|
|
|
String expected = "{id: <null>, data: {name: , description: ," +
|
|
|
|
String s = removePointers(h.toString());
|
|
|
|
" frequency: {numerator: 3, denominator: 7}," +
|
|
|
|
|
|
|
|
" color: 8, archived: false, targetType: 0," +
|
|
|
|
String expected =
|
|
|
|
" targetValue: 100.0, type: 0, unit: ," +
|
|
|
|
"org.isoron.uhabits.core.models.Habit@00000000[" +
|
|
|
|
" reminder: {hour: 22, minute: 30," +
|
|
|
|
"id=<null>," +
|
|
|
|
" days: {weekdays: [true,true,true,true,true,true,true]}}," +
|
|
|
|
"data=org.isoron.uhabits.core.models.Habit$HabitData@00000000[" +
|
|
|
|
" position: 0}}";
|
|
|
|
"name=,description=," +
|
|
|
|
|
|
|
|
"frequency=org.isoron.uhabits.core.models.Frequency@00000000[numerator=3,denominator=7]," +
|
|
|
|
assertThat(h.toString(), equalTo(expected));
|
|
|
|
"color=8,archived=false,targetType=0,targetValue=100.0,type=0,unit=," +
|
|
|
|
|
|
|
|
"reminder=org.isoron.uhabits.core.models.Reminder@00000000[" +
|
|
|
|
|
|
|
|
"hour=22,minute=30," +
|
|
|
|
|
|
|
|
"days=org.isoron.uhabits.core.models.WeekdayList@00000000[" +
|
|
|
|
|
|
|
|
"weekdays={true,true,true,true,true,true,true}]]," +
|
|
|
|
|
|
|
|
"position=0]]";
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
assertThat(s, equalTo(expected));
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|