public void testGetLastSuccessfulSyncDate_NoDate()
{
assertNull(DatabaseRecoverer.getLastSuccessfulSyncDate((GlobalModel)null));
assertNull(DatabaseRecoverer.getLastSuccessfulSyncDate((ServicePreferences)null));
ServicePreferences prefs = new ServicePreferences();
prefs.setLastSyncOutDate(null);
prefs.setLastSyncInDate(null);
prefs.setEmail(null);
assertNull("Account info isn't entered.",
DatabaseRecoverer.getLastSuccessfulSyncDate(prefs));
prefs.setEmail("1");
prefs.setPassword("2");
assertTrue(prefs.isAccountInformationEntered());
assertNull("Statuses and dates aren't set",
DatabaseRecoverer.getLastSuccessfulSyncDate(prefs));
prefs.setLastSyncInStatus(null);
prefs.setLastSyncOutStatus(null);
prefs.setLastSyncInDate(new Date());
prefs.setLastSyncOutDate(new Date());
assertNull("Success status isn't set.",
DatabaseRecoverer.getLastSuccessfulSyncDate(prefs));
prefs.setLastSyncInStatus(ServicePreferences.SYNC_STATUS_FAILURE);
prefs.setLastSyncOutStatus(ServicePreferences.SYNC_STATUS_FAILURE);
assertNull("Success statuses aren't set.",
DatabaseRecoverer.getLastSuccessfulSyncDate(prefs));
}