Promote { public static Promote ban(Context c, int id) { prefs(c).edit().putBoolean("promote:" + id + ":banned", true).apply(); return null; }  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 testBan() { assertThat(Promote.after(1).times().show(c, 100, null), is(false)); assertThat(Promote.after(1).times().show(c, 100, null), is(true)); assertThat(Promote.after(1).times().show(c, 100, null), is(true)); Promote.ban(c, 100); assertThat(Promote.after(1).times().show(c, 100, null), is(false)); assertThat(Promote.after(1).times().show(c, 100, null), is(false)); }