mirror of
https://github.com/iSoron/uhabits.git
synced 2025-12-07 01:28:52 -06:00
Introduce HabitType and NumericalHabitType enums
This commit is contained in:
@@ -84,8 +84,8 @@ class HabitTest : BaseUnitTest() {
|
||||
@Throws(Exception::class)
|
||||
fun test_isCompleted_numerical() {
|
||||
val h = modelFactory.buildHabit()
|
||||
h.type = Habit.NUMBER_HABIT
|
||||
h.targetType = Habit.AT_LEAST
|
||||
h.type = HabitType.NUMERICAL
|
||||
h.targetType = NumericalHabitType.AT_LEAST
|
||||
h.targetValue = 100.0
|
||||
assertFalse(h.isCompletedToday())
|
||||
h.originalEntries.add(Entry(getToday(), 200000))
|
||||
@@ -97,7 +97,7 @@ class HabitTest : BaseUnitTest() {
|
||||
h.originalEntries.add(Entry(getToday(), 50000))
|
||||
h.recompute()
|
||||
assertFalse(h.isCompletedToday())
|
||||
h.targetType = Habit.AT_MOST
|
||||
h.targetType = NumericalHabitType.AT_MOST
|
||||
h.originalEntries.add(Entry(getToday(), 200000))
|
||||
h.recompute()
|
||||
assertFalse(h.isCompletedToday())
|
||||
|
||||
@@ -22,7 +22,8 @@ import org.hamcrest.CoreMatchers.equalTo
|
||||
import org.hamcrest.MatcherAssert.assertThat
|
||||
import org.isoron.uhabits.core.BaseUnitTest
|
||||
import org.isoron.uhabits.core.models.Frequency
|
||||
import org.isoron.uhabits.core.models.Habit
|
||||
import org.isoron.uhabits.core.models.HabitType
|
||||
import org.isoron.uhabits.core.models.NumericalHabitType
|
||||
import org.isoron.uhabits.core.models.PaletteColor
|
||||
import org.isoron.uhabits.core.models.Reminder
|
||||
import org.isoron.uhabits.core.models.WeekdayList
|
||||
@@ -59,9 +60,9 @@ class HabitRecordTest : BaseUnitTest() {
|
||||
reminder = null
|
||||
id = 1L
|
||||
position = 15
|
||||
type = Habit.NUMBER_HABIT
|
||||
type = HabitType.NUMERICAL
|
||||
targetValue = 100.0
|
||||
targetType = Habit.AT_LEAST
|
||||
targetType = NumericalHabitType.AT_LEAST
|
||||
unit = "miles"
|
||||
}
|
||||
val record = HabitRecord()
|
||||
|
||||
Reference in New Issue
Block a user