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 b9881b4
Show file tree
Hide file tree
Showing 7 changed files with 28 additions and 7 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 Down Expand Up @@ -77,22 +77,43 @@ class NumberButtonViewTest : BaseViewTest() {
}

@Test
fun testRender_emptyUnits() {
fun testRender_atMostAboveThreshold() {
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_betweenThreshold() {
view.value = 99.0
assertRenders(view, "$PATH/render_between.png")
}

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

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

@Test
fun testRender_zero() {
fun testRender_atMostBelowThreshold() {
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 b9881b4

Please sign in to comment.