mirror of
https://github.com/iSoron/uhabits.git
synced 2025-12-06 09:08:52 -06:00
Fix errors
This commit is contained in:
@@ -34,7 +34,7 @@ public class CheckmarkListTest extends BaseUnitTest
|
||||
{
|
||||
private long dayLength;
|
||||
|
||||
private long today;
|
||||
private Timestamp today;
|
||||
|
||||
private Habit nonDailyHabit;
|
||||
|
||||
@@ -55,6 +55,7 @@ public class CheckmarkListTest extends BaseUnitTest
|
||||
|
||||
numericalHabit = fixtures.createNumericalHabit();
|
||||
habitList.add(numericalHabit);
|
||||
today = DateUtils.getToday();
|
||||
}
|
||||
|
||||
@Test
|
||||
@@ -285,8 +286,8 @@ public class CheckmarkListTest extends BaseUnitTest
|
||||
@Test
|
||||
public void test_getValues_withValidInterval()
|
||||
{
|
||||
long from = today - 15 * dayLength;
|
||||
long to = today - 5 * dayLength;
|
||||
Timestamp from = today.minus(15);
|
||||
Timestamp to = today.minus(5);
|
||||
|
||||
int[] expectedValues = {
|
||||
CHECKED_EXPLICITLY,
|
||||
@@ -302,10 +303,7 @@ public class CheckmarkListTest extends BaseUnitTest
|
||||
UNCHECKED
|
||||
};
|
||||
|
||||
int[] actualValues = nonDailyHabit
|
||||
.getCheckmarks()
|
||||
.getValues(new Timestamp(from), new Timestamp(to));
|
||||
|
||||
int[] actualValues = nonDailyHabit.getCheckmarks().getValues(from, to);
|
||||
assertThat(actualValues, equalTo(expectedValues));
|
||||
}
|
||||
|
||||
|
||||
@@ -152,7 +152,7 @@ public class ListHabitsBehaviorTest extends BaseUnitTest
|
||||
@Test
|
||||
public void testOnStartup_firstLaunch()
|
||||
{
|
||||
long today = DateUtils.getStartOfToday();
|
||||
Timestamp today = DateUtils.getToday();
|
||||
|
||||
when(prefs.isFirstRun()).thenReturn(true);
|
||||
behavior.onStartup();
|
||||
|
||||
@@ -20,6 +20,7 @@
|
||||
package org.isoron.uhabits.core.utils;
|
||||
|
||||
import org.isoron.uhabits.core.*;
|
||||
import org.isoron.uhabits.core.models.*;
|
||||
import org.junit.*;
|
||||
|
||||
import java.util.*;
|
||||
@@ -34,7 +35,7 @@ public class DateUtilsTest extends BaseUnitTest
|
||||
public void testFormatHeaderDate()
|
||||
{
|
||||
long timestamp = timestamp(2015, DECEMBER, 31);
|
||||
GregorianCalendar date = DateUtils.getCalendar(timestamp);
|
||||
GregorianCalendar date = new Timestamp(timestamp).toCalendar();
|
||||
String formatted = DateUtils.formatHeaderDate(date);
|
||||
assertThat(formatted, equalTo("Thu\n31"));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user