|
|
@ -82,12 +82,12 @@ class HabitTest : BaseUnitTest() {
|
|
|
|
|
|
|
|
|
|
|
|
@Test
|
|
|
|
@Test
|
|
|
|
@Throws(Exception::class)
|
|
|
|
@Throws(Exception::class)
|
|
|
|
fun test_isFailed() {
|
|
|
|
fun test_isEntered() {
|
|
|
|
val h = modelFactory.buildHabit()
|
|
|
|
val h = modelFactory.buildHabit()
|
|
|
|
assertFalse(h.isFailedToday())
|
|
|
|
assertFalse(h.isEnteredToday())
|
|
|
|
h.originalEntries.add(Entry(getToday(), Entry.NO))
|
|
|
|
h.originalEntries.add(Entry(getToday(), Entry.NO))
|
|
|
|
h.recompute()
|
|
|
|
h.recompute()
|
|
|
|
assertTrue(h.isFailedToday())
|
|
|
|
assertTrue(h.isEnteredToday())
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@Test
|
|
|
|
@Test
|
|
|
@ -119,35 +119,6 @@ class HabitTest : BaseUnitTest() {
|
|
|
|
assertTrue(h.isCompletedToday())
|
|
|
|
assertTrue(h.isCompletedToday())
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@Test
|
|
|
|
|
|
|
|
@Throws(Exception::class)
|
|
|
|
|
|
|
|
fun test_isFailedNumerical() {
|
|
|
|
|
|
|
|
val h = modelFactory.buildHabit()
|
|
|
|
|
|
|
|
h.type = HabitType.NUMERICAL
|
|
|
|
|
|
|
|
h.targetType = NumericalHabitType.AT_LEAST
|
|
|
|
|
|
|
|
h.targetValue = 100.0
|
|
|
|
|
|
|
|
assertTrue(h.isFailedToday())
|
|
|
|
|
|
|
|
h.originalEntries.add(Entry(getToday(), 200000))
|
|
|
|
|
|
|
|
h.recompute()
|
|
|
|
|
|
|
|
assertFalse(h.isFailedToday())
|
|
|
|
|
|
|
|
h.originalEntries.add(Entry(getToday(), 100000))
|
|
|
|
|
|
|
|
h.recompute()
|
|
|
|
|
|
|
|
assertFalse(h.isFailedToday())
|
|
|
|
|
|
|
|
h.originalEntries.add(Entry(getToday(), 50000))
|
|
|
|
|
|
|
|
h.recompute()
|
|
|
|
|
|
|
|
assertTrue(h.isFailedToday())
|
|
|
|
|
|
|
|
h.targetType = NumericalHabitType.AT_MOST
|
|
|
|
|
|
|
|
h.originalEntries.add(Entry(getToday(), 200000))
|
|
|
|
|
|
|
|
h.recompute()
|
|
|
|
|
|
|
|
assertTrue(h.isFailedToday())
|
|
|
|
|
|
|
|
h.originalEntries.add(Entry(getToday(), 100000))
|
|
|
|
|
|
|
|
h.recompute()
|
|
|
|
|
|
|
|
assertFalse(h.isFailedToday())
|
|
|
|
|
|
|
|
h.originalEntries.add(Entry(getToday(), 50000))
|
|
|
|
|
|
|
|
h.recompute()
|
|
|
|
|
|
|
|
assertFalse(h.isFailedToday())
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Test
|
|
|
|
@Test
|
|
|
|
@Throws(Exception::class)
|
|
|
|
@Throws(Exception::class)
|
|
|
|
fun testURI() {
|
|
|
|
fun testURI() {
|
|
|
|