Fix test case
This commit is contained in:
parent
3d8360998f
commit
ce4756dd10
|
@ -10,12 +10,11 @@ public class SupportDialogTest {
|
|||
|
||||
@Test
|
||||
public void feelingLucky() {
|
||||
assertTrue(SupportDialog.AppStoreReview.feelingLucky(2000, 2000, 500, -1, 0));
|
||||
assertFalse(SupportDialog.AppStoreReview.feelingLucky(2000, 2000, 400, 400, 1));
|
||||
|
||||
assertTrue(SupportDialog.Donation.feelingLucky(2000, 2000, 400, -1, 0));
|
||||
assertFalse(SupportDialog.Donation.feelingLucky(100, 100, 400, -1, 0));
|
||||
assertFalse(SupportDialog.Donation.feelingLucky(2000, 2000, 400, 400, 1));
|
||||
|
||||
// make sure that it happens sometimes or never
|
||||
assertTrue(IntStream.range(0, 100).anyMatch(i -> SupportDialog.AppStoreReview.feelingLucky(6001, 5001, 500, -1, 0)));
|
||||
assertTrue(IntStream.range(0, 100).noneMatch(i -> SupportDialog.AppStoreReview.feelingLucky(2000, 2000, 400, 400, 1)));
|
||||
|
||||
assertTrue(IntStream.range(0, 100).anyMatch(i -> SupportDialog.Donation.feelingLucky(0, 5000, 400, -1, 0)));
|
||||
assertFalse(IntStream.range(0, 100).anyMatch(i -> SupportDialog.Donation.feelingLucky(0, 5000, 400, 400, 2)));
|
||||
|
|
Loading…
Reference in New Issue