@SuppressLint("Assert") @SuppressWarnings("ConstantConditions") @Test public void testThatRuleBlocksPromptIfCountThresholdHasNotBeenExceeded() { final int minimumEventCount = 7; final int currentEventCount = 2; assert currentEventCount < minimumEventCount; final MinimumCountRule minimumCountRule = new MinimumCountRule(minimumEventCount); final boolean ruleShouldAllowFeedbackPrompt = minimumCountRule.shouldAllowFeedbackPrompt(currentEventCount); assertFalse( "Feedback prompt should be blocked if the count threshold is not met or exceeded", ruleShouldAllowFeedbackPrompt); }
@Override public boolean shouldAllowFeedbackPrompt(@NonNull final Integer cachedEventValue) { return cachedEventValue >= minimumCount; }
MinimumCountRule implements IEventBasedRule<Integer> { @Override public boolean shouldAllowFeedbackPrompt(@NonNull final Integer cachedEventValue) { return cachedEventValue >= minimumCount; } }
MinimumCountRule implements IEventBasedRule<Integer> { @Override public boolean shouldAllowFeedbackPrompt(@NonNull final Integer cachedEventValue) { return cachedEventValue >= minimumCount; } MinimumCountRule(final int minimumCount); }
MinimumCountRule implements IEventBasedRule<Integer> { @Override public boolean shouldAllowFeedbackPrompt(@NonNull final Integer cachedEventValue) { return cachedEventValue >= minimumCount; } MinimumCountRule(final int minimumCount); @Override boolean shouldAllowFeedbackPromptByDefault(); @Override boolean shouldAllowFeedbackPrompt(@NonNull final Integer cachedEventValue); @NonNull @Override String getDescription(); }
MinimumCountRule implements IEventBasedRule<Integer> { @Override public boolean shouldAllowFeedbackPrompt(@NonNull final Integer cachedEventValue) { return cachedEventValue >= minimumCount; } MinimumCountRule(final int minimumCount); @Override boolean shouldAllowFeedbackPromptByDefault(); @Override boolean shouldAllowFeedbackPrompt(@NonNull final Integer cachedEventValue); @NonNull @Override String getDescription();  }