mirror of
https://github.com/iSoron/uhabits.git
synced 2025-12-07 01:28:52 -06:00
Repetition: Replace toggle by setValue
This commit is contained in:
@@ -22,6 +22,8 @@ package org.isoron.uhabits;
|
||||
import org.isoron.uhabits.core.models.*;
|
||||
import org.isoron.uhabits.core.utils.DateUtils;
|
||||
|
||||
import static org.isoron.uhabits.core.models.Checkmark.*;
|
||||
|
||||
public class HabitFixtures
|
||||
{
|
||||
public boolean LONG_HABIT_CHECKS[] = {
|
||||
@@ -73,7 +75,7 @@ public class HabitFixtures
|
||||
81, 83, 89, 90, 91, 95, 102, 103, 108, 109, 120};
|
||||
|
||||
for (int mark : marks)
|
||||
habit.getRepetitions().toggle(today.minus(mark));
|
||||
habit.getRepetitions().setValue(today.minus(mark), YES_MANUAL);
|
||||
|
||||
return habit;
|
||||
}
|
||||
@@ -107,7 +109,7 @@ public class HabitFixtures
|
||||
582, 583, 584, 586, 589};
|
||||
|
||||
for (int mark : marks)
|
||||
habit.getRepetitions().toggle(today.minus(mark));
|
||||
habit.getRepetitions().setValue(today.minus(mark), YES_MANUAL);
|
||||
|
||||
return habit;
|
||||
}
|
||||
@@ -145,7 +147,7 @@ public class HabitFixtures
|
||||
Timestamp timestamp = DateUtils.getToday();
|
||||
for (boolean c : LONG_HABIT_CHECKS)
|
||||
{
|
||||
if (c) habit.getRepetitions().toggle(timestamp);
|
||||
if (c) habit.getRepetitions().setValue(timestamp, YES_MANUAL);
|
||||
timestamp = timestamp.minus(1);
|
||||
}
|
||||
|
||||
|
||||
@@ -64,7 +64,7 @@ public class WidgetControllerTest extends BaseAndroidJVMTest
|
||||
@Test
|
||||
public void testOnAddRepetition_whenChecked() throws Exception
|
||||
{
|
||||
habit.getRepetitions().toggle(today);
|
||||
habit.getRepetitions().setValue(today, YES_MANUAL);
|
||||
int todayValue = habit.getCheckmarks().getTodayValue();
|
||||
assertThat(todayValue, equalTo(YES_MANUAL));
|
||||
controller.onAddRepetition(habit, today);
|
||||
@@ -84,7 +84,7 @@ public class WidgetControllerTest extends BaseAndroidJVMTest
|
||||
@Test
|
||||
public void testOnRemoveRepetition_whenChecked() throws Exception
|
||||
{
|
||||
habit.getRepetitions().toggle(today);
|
||||
habit.getRepetitions().setValue(today, YES_MANUAL);
|
||||
int todayValue = habit.getCheckmarks().getTodayValue();
|
||||
assertThat(todayValue, equalTo(YES_MANUAL));
|
||||
controller.onRemoveRepetition(habit, today);
|
||||
|
||||
Reference in New Issue
Block a user