public void LastDownloadZipsTooRecent_ShouldReturnTrue() { // Given PullRules pullRules = new PullRules(); SystemTime.ResetDateTime(); // When _preferences.Set(PreferencesKeys.LAST_PULL_KEYS_SUCCEEDED_DATE_TIME, SystemTime.Now().AddMinutes(-1)); bool lastDownloadZipsTooRecent = pullRules.LastDownloadZipsTooRecent(); // Then Assert.True(lastDownloadZipsTooRecent); }
public void ShouldAbortPull_MobileDataEnabled_Should_ReturnFalse() { // Given PullRules pullRules = new PullRules(); ConnectivityHelper.MockConnectionProfiles(new List <ConnectionProfile> { ConnectionProfile.Cellular }); LocalPreferencesHelper.SetIsDownloadWithMobileDataEnabled(true); // When bool shouldAbortPull = pullRules.ShouldAbortPull(); // Then Assert.False(shouldAbortPull); ConnectivityHelper.ResetConnectionProfiles(); }
public void ShouldAbortPull_MobileDataEnabled_NotSavedLog() { // Given PullRules pullRules = new PullRules(); ConnectivityHelper.MockConnectionProfiles(new List <ConnectionProfile> { ConnectionProfile.Cellular }); LocalPreferencesHelper.SetIsDownloadWithMobileDataEnabled(true); // When string pullKeyInfoPre = _developerToolsService.LastPullHistory; pullRules.ShouldAbortPull(); string pullKeyInfoPost = _developerToolsService.LastPullHistory; // Then Assert.Empty(pullKeyInfoPre); Assert.Empty(pullKeyInfoPost); ConnectivityHelper.ResetConnectionProfiles(); }