diff --git a/test/net/filebot/ui/SupportDialogTest.java b/test/net/filebot/ui/SupportDialogTest.java index d788cfce..8879e372 100644 --- a/test/net/filebot/ui/SupportDialogTest.java +++ b/test/net/filebot/ui/SupportDialogTest.java @@ -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)));