Skip to content

Commit

Permalink
fix(ratings): Add more tests
Browse files Browse the repository at this point in the history
  • Loading branch information
olivierperez committed Oct 10, 2023
1 parent 4a72cbe commit 0e06ef3
Showing 1 changed file with 10 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,11 @@ class IconTest {
assertStars(number = 3.2f, Icon.Fill, Icon.Fill, Icon.Fill, Icon.Empty, Icon.Empty)
}

@Test
fun lower_limit_of_half() {
assertStars(number = 3.25f, Icon.Fill, Icon.Fill, Icon.Fill, Icon.Half, Icon.Empty)
}

@Test
fun close_below_half() {
assertStars(number = 3.4f, Icon.Fill, Icon.Fill, Icon.Fill, Icon.Half, Icon.Empty)
Expand All @@ -29,6 +34,11 @@ class IconTest {
assertStars(number = 3.6f, Icon.Fill, Icon.Fill, Icon.Fill, Icon.Half, Icon.Empty)
}

@Test
fun high_limit_of_half() {
assertStars(number = 3.75f, Icon.Fill, Icon.Fill, Icon.Fill, Icon.Half, Icon.Empty)
}

@Test
fun close_below_int() {
assertStars(number = 3.8f, Icon.Fill, Icon.Fill, Icon.Fill, Icon.Fill, Icon.Empty)
Expand Down

0 comments on commit 0e06ef3

Please sign in to comment.