public void IsReportingEnabled_ZeroSuspension_ReturnTrue() { FreezeSystemTime(SystemTime.Now()); MetricsState.SuspendReporting(TimeSpan.FromMinutes(0)); var result = MetricsState.IsReportingEnabled(); Assert.That(result, Is.True); }
public void IsReportingEnabled_SuspensionNotOverButEnabledExplicitly_ReturnTrue() { var suspension = TimeSpan.FromSeconds(10); FreezeSystemTime(SystemTime.Now()); MetricsState.SuspendReporting(suspension); MetricsState.EnableReporting(); var result = MetricsState.IsReportingEnabled(); Assert.That(result, Is.True); }
public void IsReportingEnabled_SuspensionEnded_ReturnTrue() { var now = SystemTime.Now(); FreezeSystemTime(now); const int seconds = 10; var suspension = TimeSpan.FromSeconds(seconds); MetricsState.SuspendReporting(suspension); var futureNow = now.AddSeconds(seconds + 1); FreezeSystemTime(futureNow); var result = MetricsState.IsReportingEnabled(); Assert.That(result, Is.True); }
public void IsReportingEnabled_SuspensionIsOverButDisabledExplicitly_ReturnFalse() { var now = SystemTime.Now(); FreezeSystemTime(now); const int seconds = 10; var suspension = TimeSpan.FromSeconds(seconds); MetricsState.SuspendReporting(suspension); var futureNow = now.AddSeconds(seconds + 1); FreezeSystemTime(futureNow); MetricsState.DisableReporting(); var result = MetricsState.IsReportingEnabled(); Assert.That(result, Is.False); }
public void IsReportingEnabled_NoSuspension_ReturnTrue() { var result = MetricsState.IsReportingEnabled(); Assert.That(result, Is.True); }