Promote { public static Condition.Value every(int n) { return new Condition().every(n); }  static Condition.Value after(int n); static Condition.Value every(int n); static Condition.Value every(int n, float backoff); static Promote ban(Context c, int id); static Promote reset(Context c); final static int RATE; final static int SHARE; final static int FACEBOOK_TWITTER; final static int TWITTER_FACEBOOK; final static int FACEBOOK; final static int TWITTER; }
@Test public void testEvery() { assertThat(Promote.every(2).times().show(c, 100, null), is(true)); assertThat(Promote.every(2).times().show(c, 100, null), is(false)); assertThat(Promote.every(2).times().show(c, 100, null), is(true)); assertThat(Promote.every(2).times().show(c, 100, null), is(false)); assertThat(Promote.every(2).times().show(c, 100, null), is(true)); assertThat(Promote.every(2).times().show(c, 100, null), is(false)); }
@Test public void testEveryChanged() { assertThat(Promote.every(2).times().show(c, 100, null), is(true)); assertThat(Promote.every(2).times().show(c, 100, null), is(false)); assertThat(Promote.every(2).times().show(c, 100, null), is(true)); assertThat(Promote.every(3).times().show(c, 100, null), is(false)); assertThat(Promote.every(3).times().show(c, 100, null), is(false)); assertThat(Promote.every(3).times().show(c, 100, null), is(true)); assertThat(Promote.every(3).times().show(c, 100, null), is(false)); assertThat(Promote.every(3).times().show(c, 100, null), is(false)); assertThat(Promote.every(3).times().show(c, 100, null), is(true)); assertThat(Promote.every(2).times().show(c, 100, null), is(false)); assertThat(Promote.every(2).times().show(c, 100, null), is(true)); }
@Test public void testEveryBackoff() { assertThat(Promote.every(2, 2f).times().show(c, 100, null), is(true)); assertThat(Promote.every(2, 2f).times().show(c, 100, null), is(false)); assertThat(Promote.every(2, 2f).times().show(c, 100, null), is(true)); assertThat(Promote.every(2, 2f).times().show(c, 100, null), is(false)); assertThat(Promote.every(2, 2f).times().show(c, 100, null), is(false)); assertThat(Promote.every(2, 2f).times().show(c, 100, null), is(false)); assertThat(Promote.every(2, 2f).times().show(c, 100, null), is(true)); assertThat(Promote.every(2, 2f).times().show(c, 100, null), is(false)); assertThat(Promote.every(2, 2f).times().show(c, 100, null), is(false)); assertThat(Promote.every(2, 2f).times().show(c, 100, null), is(false)); assertThat(Promote.every(2, 2f).times().show(c, 100, null), is(false)); assertThat(Promote.every(2, 2f).times().show(c, 100, null), is(false)); assertThat(Promote.every(2, 2f).times().show(c, 100, null), is(false)); assertThat(Promote.every(2, 2f).times().show(c, 100, null), is(false)); assertThat(Promote.every(2, 2f).times().show(c, 100, null), is(true)); assertThat(Promote.every(2, 2f).times().show(c, 100, null), is(false)); }