@Test public void whenUserIsNotANewInstallAndFlagIsEnabled_whenIShouldDisplay_thenIExpectTrue() { when(registrationValues.pinWasRequiredAtRegistration()).thenReturn(false); boolean result = testSubject.shouldDisplay(0, 0, 0, System.currentTimeMillis()); assertTrue(result); }
@Override public boolean shouldDisplay(int seenCount, long lastSeen, long firstVisible, long currentTime) { if (!isEnabled()) { return false; } if (shouldDisplayFullScreen(firstVisible, currentTime)) { return true; } else { boolean shouldDisplay = schedule.shouldDisplay(seenCount, lastSeen, firstVisible, currentTime); Log.i(TAG, String.format(Locale.ENGLISH, "seenCount: %d, lastSeen: %d, firstVisible: %d, currentTime: %d, result: %b", seenCount, lastSeen, firstVisible, currentTime, shouldDisplay)); return shouldDisplay; } }
PinsForAllSchedule implements MegaphoneSchedule { @Override public boolean shouldDisplay(int seenCount, long lastSeen, long firstVisible, long currentTime) { if (!isEnabled()) { return false; } if (shouldDisplayFullScreen(firstVisible, currentTime)) { return true; } else { boolean shouldDisplay = schedule.shouldDisplay(seenCount, lastSeen, firstVisible, currentTime); Log.i(TAG, String.format(Locale.ENGLISH, "seenCount: %d, lastSeen: %d, firstVisible: %d, currentTime: %d, result: %b", seenCount, lastSeen, firstVisible, currentTime, shouldDisplay)); return shouldDisplay; } } }
PinsForAllSchedule implements MegaphoneSchedule { @Override public boolean shouldDisplay(int seenCount, long lastSeen, long firstVisible, long currentTime) { if (!isEnabled()) { return false; } if (shouldDisplayFullScreen(firstVisible, currentTime)) { return true; } else { boolean shouldDisplay = schedule.shouldDisplay(seenCount, lastSeen, firstVisible, currentTime); Log.i(TAG, String.format(Locale.ENGLISH, "seenCount: %d, lastSeen: %d, firstVisible: %d, currentTime: %d, result: %b", seenCount, lastSeen, firstVisible, currentTime, shouldDisplay)); return shouldDisplay; } }  }
PinsForAllSchedule implements MegaphoneSchedule { @Override public boolean shouldDisplay(int seenCount, long lastSeen, long firstVisible, long currentTime) { if (!isEnabled()) { return false; } if (shouldDisplayFullScreen(firstVisible, currentTime)) { return true; } else { boolean shouldDisplay = schedule.shouldDisplay(seenCount, lastSeen, firstVisible, currentTime); Log.i(TAG, String.format(Locale.ENGLISH, "seenCount: %d, lastSeen: %d, firstVisible: %d, currentTime: %d, result: %b", seenCount, lastSeen, firstVisible, currentTime, shouldDisplay)); return shouldDisplay; } }  @Override boolean shouldDisplay(int seenCount, long lastSeen, long firstVisible, long currentTime); }
PinsForAllSchedule implements MegaphoneSchedule { @Override public boolean shouldDisplay(int seenCount, long lastSeen, long firstVisible, long currentTime) { if (!isEnabled()) { return false; } if (shouldDisplayFullScreen(firstVisible, currentTime)) { return true; } else { boolean shouldDisplay = schedule.shouldDisplay(seenCount, lastSeen, firstVisible, currentTime); Log.i(TAG, String.format(Locale.ENGLISH, "seenCount: %d, lastSeen: %d, firstVisible: %d, currentTime: %d, result: %b", seenCount, lastSeen, firstVisible, currentTime, shouldDisplay)); return shouldDisplay; } }  @Override boolean shouldDisplay(int seenCount, long lastSeen, long firstVisible, long currentTime);  }