@SuppressLint("Assert") @SuppressWarnings("ConstantConditions") @Test public void testThatRuleAllowsPromptIfCountThresholdHasNotBeenExceeded() { final int maximumEventCount = 7; final int currentEventCount = 2; assert currentEventCount < maximumEventCount; final MaximumCountRule maximumCountRule = new MaximumCountRule(maximumEventCount); final boolean ruleShouldAllowFeedbackPrompt = maximumCountRule.shouldAllowFeedbackPrompt(currentEventCount); assertTrue( "Feedback prompt should be allowed if the count threshold has not been exceeded", ruleShouldAllowFeedbackPrompt); }
@Override public boolean shouldAllowFeedbackPrompt(@NonNull final Integer cachedEventValue) { return cachedEventValue < maximumCount; }
MaximumCountRule implements IEventBasedRule<Integer> { @Override public boolean shouldAllowFeedbackPrompt(@NonNull final Integer cachedEventValue) { return cachedEventValue < maximumCount; } }
MaximumCountRule implements IEventBasedRule<Integer> { @Override public boolean shouldAllowFeedbackPrompt(@NonNull final Integer cachedEventValue) { return cachedEventValue < maximumCount; } MaximumCountRule(final int maximumCount); }
MaximumCountRule implements IEventBasedRule<Integer> { @Override public boolean shouldAllowFeedbackPrompt(@NonNull final Integer cachedEventValue) { return cachedEventValue < maximumCount; } MaximumCountRule(final int maximumCount); @Override boolean shouldAllowFeedbackPromptByDefault(); @Override boolean shouldAllowFeedbackPrompt(@NonNull final Integer cachedEventValue); @NonNull @Override String getDescription(); }
MaximumCountRule implements IEventBasedRule<Integer> { @Override public boolean shouldAllowFeedbackPrompt(@NonNull final Integer cachedEventValue) { return cachedEventValue < maximumCount; } MaximumCountRule(final int maximumCount); @Override boolean shouldAllowFeedbackPromptByDefault(); @Override boolean shouldAllowFeedbackPrompt(@NonNull final Integer cachedEventValue); @NonNull @Override String getDescription();  }