Fix default color and failing tests
This commit is contained in:
parent
cf25229fbc
commit
277738f94d
@ -53,7 +53,7 @@ public class HabitFixtures
|
||||
Habit habit = modelFactory.buildHabit();
|
||||
habit.setName("Meditate");
|
||||
habit.setDescription("Did you meditate this morning?");
|
||||
habit.setColor(3);
|
||||
habit.setColor(5);
|
||||
habit.setFrequency(Frequency.DAILY);
|
||||
habit.setId(id);
|
||||
habitList.add(habit);
|
||||
@ -64,7 +64,7 @@ public class HabitFixtures
|
||||
{
|
||||
Habit habit = createEmptyHabit();
|
||||
habit.setFrequency(new Frequency(3, 7));
|
||||
habit.setColor(4);
|
||||
habit.setColor(7);
|
||||
|
||||
long day = DateUtils.millisecondsInOneDay;
|
||||
long today = DateUtils.getStartOfToday();
|
||||
|
||||
@ -51,7 +51,7 @@ public class NumberButtonViewTest extends BaseViewTest
|
||||
view = new NumberButtonView(targetContext);
|
||||
view.setUnit("steps");
|
||||
view.setThreshold(100.0);
|
||||
view.setColor(ColorUtils.getAndroidTestColor(5));
|
||||
view.setColor(ColorUtils.getAndroidTestColor(8));
|
||||
|
||||
measureView(view, dpToPixels(48), dpToPixels(48));
|
||||
|
||||
|
||||
@ -180,8 +180,8 @@ public class HabitListTest extends BaseAndroidTest
|
||||
|
||||
String expectedCSV =
|
||||
"Position,Name,Description,NumRepetitions,Interval,Color\n" +
|
||||
"001,Meditate,Did you meditate this morning?,1,1,#F9A825\n" +
|
||||
"002,Wake up early,Did you wake up before 6am?,2,3,#388E3C\n";
|
||||
"001,Meditate,Did you meditate this morning?,1,1,#FF8F00\n" +
|
||||
"002,Wake up early,Did you wake up before 6am?,2,3,#AFB42B\n";
|
||||
|
||||
StringWriter writer = new StringWriter();
|
||||
habitList.writeCSV(writer);
|
||||
|
||||
@ -372,7 +372,7 @@ public class Habit
|
||||
|
||||
public HabitData()
|
||||
{
|
||||
this.color = 5;
|
||||
this.color = 8;
|
||||
this.archived = false;
|
||||
this.frequency = new Frequency(3, 7);
|
||||
this.type = YES_NO_HABIT;
|
||||
|
||||
@ -94,13 +94,13 @@ public class ListHabitsSelectionMenuBehaviorTest extends BaseUnitTest
|
||||
@Test
|
||||
public void onChangeColor() throws Exception
|
||||
{
|
||||
assertThat(habit1.getColor(), equalTo(5));
|
||||
assertThat(habit2.getColor(), equalTo(5));
|
||||
assertThat(habit1.getColor(), equalTo(8));
|
||||
assertThat(habit2.getColor(), equalTo(8));
|
||||
when(adapter.getSelected()).thenReturn(asList(habit1, habit2));
|
||||
|
||||
behavior.onChangeColor();
|
||||
|
||||
verify(screen).showColorPicker(eq(5), colorPickerCallback.capture());
|
||||
verify(screen).showColorPicker(eq(8), colorPickerCallback.capture());
|
||||
colorPickerCallback.getValue().onColorPicked(30);
|
||||
assertThat(habit1.getColor(), equalTo(30));
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user