2016-09-19 12:24:15 -04:00
|
|
|
package net.filebot.ui;
|
|
|
|
|
|
|
|
import static org.junit.Assert.*;
|
|
|
|
|
|
|
|
import java.util.stream.IntStream;
|
|
|
|
|
|
|
|
import org.junit.Test;
|
|
|
|
|
|
|
|
public class SupportDialogTest {
|
|
|
|
|
|
|
|
@Test
|
|
|
|
public void feelingLucky() {
|
2016-10-20 15:48:33 -04:00
|
|
|
assertTrue(SupportDialog.AppStoreReview.feelingLucky(2000, 2000, 500, -1, 0));
|
2016-09-20 03:32:50 -04:00
|
|
|
assertFalse(SupportDialog.AppStoreReview.feelingLucky(2000, 2000, 400, 400, 1));
|
2016-09-19 12:24:15 -04:00
|
|
|
|
2016-10-20 15:48:33 -04:00
|
|
|
assertTrue(SupportDialog.Donation.feelingLucky(2000, 2000, 400, -1, 0));
|
|
|
|
assertFalse(SupportDialog.Donation.feelingLucky(100, 100, 400, -1, 0));
|
2016-09-20 03:32:50 -04:00
|
|
|
assertFalse(SupportDialog.Donation.feelingLucky(2000, 2000, 400, 400, 1));
|
2016-09-19 12:24:15 -04:00
|
|
|
|
2016-10-20 15:48:33 -04:00
|
|
|
assertTrue(IntStream.range(0, 100).anyMatch(i -> SupportDialog.Donation.feelingLucky(0, 5000, 400, -1, 0)));
|
2016-09-19 12:24:15 -04:00
|
|
|
assertFalse(IntStream.range(0, 100).anyMatch(i -> SupportDialog.Donation.feelingLucky(0, 5000, 400, 400, 2)));
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|