mirror of
https://github.com/iSoron/uhabits.git
synced 2025-12-06 01:08:50 -06:00
Add missing tests for RepetitionList and Habit
This commit is contained in:
@@ -73,7 +73,7 @@ public class HabitFixtures
|
||||
81, 83, 89, 90, 91, 95, 102, 103, 108, 109, 120};
|
||||
|
||||
for (int mark : marks)
|
||||
habit.getRepetitions().toggleTimestamp(today - mark * day);
|
||||
habit.getRepetitions().toggle(today - mark * day);
|
||||
|
||||
return habit;
|
||||
}
|
||||
@@ -108,7 +108,7 @@ public class HabitFixtures
|
||||
long timestamp = DateUtils.getStartOfToday();
|
||||
for (boolean c : LONG_HABIT_CHECKS)
|
||||
{
|
||||
if (c) habit.getRepetitions().toggleTimestamp(timestamp);
|
||||
if (c) habit.getRepetitions().toggle(timestamp);
|
||||
timestamp -= DateUtils.millisecondsInOneDay;
|
||||
}
|
||||
|
||||
|
||||
@@ -108,7 +108,7 @@ public class HabitBullCSVImporter extends AbstractImporter
|
||||
}
|
||||
|
||||
if(!h.getRepetitions().containsTimestamp(timestamp))
|
||||
h.getRepetitions().toggleTimestamp(timestamp);
|
||||
h.getRepetitions().toggle(timestamp);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -101,7 +101,7 @@ public class RewireDBImporter extends AbstractImporter
|
||||
GregorianCalendar cal = DateUtils.getStartOfTodayCalendar();
|
||||
cal.set(year, month - 1, day);
|
||||
|
||||
habit.getRepetitions().toggleTimestamp(cal.getTimeInMillis());
|
||||
habit.getRepetitions().toggle(cal.getTimeInMillis());
|
||||
} while (c.moveToNext());
|
||||
}
|
||||
finally
|
||||
|
||||
@@ -100,7 +100,7 @@ public class TickmateDBImporter extends AbstractImporter
|
||||
GregorianCalendar cal = DateUtils.getStartOfTodayCalendar();
|
||||
cal.set(year, month, day);
|
||||
|
||||
habit.getRepetitions().toggleTimestamp(cal.getTimeInMillis());
|
||||
habit.getRepetitions().toggle(cal.getTimeInMillis());
|
||||
} while (c.moveToNext());
|
||||
}
|
||||
finally
|
||||
|
||||
@@ -59,7 +59,7 @@ public class WidgetControllerTest extends BaseAndroidUnitTest
|
||||
@Test
|
||||
public void testOnAddRepetition_whenChecked() throws Exception
|
||||
{
|
||||
habit.getRepetitions().toggleTimestamp(today);
|
||||
habit.getRepetitions().toggle(today);
|
||||
int todayValue = habit.getCheckmarks().getTodayValue();
|
||||
assertThat(todayValue, equalTo(CHECKED_EXPLICITLY));
|
||||
controller.onAddRepetition(habit, today);
|
||||
@@ -79,7 +79,7 @@ public class WidgetControllerTest extends BaseAndroidUnitTest
|
||||
@Test
|
||||
public void testOnRemoveRepetition_whenChecked() throws Exception
|
||||
{
|
||||
habit.getRepetitions().toggleTimestamp(today);
|
||||
habit.getRepetitions().toggle(today);
|
||||
int todayValue = habit.getCheckmarks().getTodayValue();
|
||||
assertThat(todayValue, equalTo(CHECKED_EXPLICITLY));
|
||||
controller.onRemoveRepetition(habit, today);
|
||||
|
||||
Reference in New Issue
Block a user