Skip to content

Commit

Permalink
add more tests for AT_MOST
Browse files Browse the repository at this point in the history
  • Loading branch information
KristianTashkov committed Sep 12, 2021
1 parent 697fffb commit 1a56260
Show file tree
Hide file tree
Showing 7 changed files with 29 additions and 8 deletions.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ class NumberButtonViewTest : BaseViewTest() {
view = component.getNumberButtonViewFactory().create().apply {
units = "steps"
targetType = NumericalHabitType.AT_LEAST
lowerThreshold = 0.0
lowerThreshold = 50.0
higherThreshold = 100.0
color = PaletteUtils.getAndroidTestColor(8)
onEdit = { edited = true }
Expand All @@ -71,28 +71,49 @@ class NumberButtonViewTest : BaseViewTest() {
}

@Test
fun testRender_aboveThreshold() {
fun testRender_aboveHigherThreshold() {
view.value = 500.0
assertRenders(view, "$PATH/render_above.png")
}

@Test
fun testRender_emptyUnits() {
fun testRender_atMostAboveHigherThreshold() {
view.value = 500.0
view.units = ""
assertRenders(view, "$PATH/render_unitless.png")
view.targetType = NumericalHabitType.AT_MOST
assertRenders(view, "$PATH/render_at_most_above.png")
}

@Test
fun testRender_belowThreshold() {
fun testRender_betweenThresholds() {
view.value = 99.0
assertRenders(view, "$PATH/render_between.png")
}

@Test
fun testRender_atMostBetweenThresholds() {
view.value = 99.0
view.targetType = NumericalHabitType.AT_MOST
assertRenders(view, "$PATH/render_at_most_between.png")
}

@Test
fun testRender_belowLowerThreshold() {
view.value = 0.0
assertRenders(view, "$PATH/render_below.png")
}

@Test
fun testRender_zero() {
fun testRender_atMostBelowLowerThreshold() {
view.value = 0.0
assertRenders(view, "$PATH/render_zero.png")
view.targetType = NumericalHabitType.AT_MOST
assertRenders(view, "$PATH/render_at_most_below.png")
}

@Test
fun testRender_emptyUnits() {
view.value = 500.0
view.units = ""
assertRenders(view, "$PATH/render_unitless.png")
}

@Test
Expand Down

0 comments on commit 1a56260

Please sign in to comment.