Exemplo n.º 1
0
        public void IsReportingEnabled_ZeroSuspension_ReturnTrue()
        {
            FreezeSystemTime(SystemTime.Now());
            GraphiteState.SuspendReporting(TimeSpan.FromMinutes(0));

            var result = GraphiteState.IsReportingEnabled();

            Assert.That(result, Is.True);
        }
Exemplo n.º 2
0
        public void IsReportingEnabled_SuspensionNotOverButEnabledExplicitly_ReturnTrue()
        {
            var suspension = TimeSpan.FromSeconds(10);

            FreezeSystemTime(SystemTime.Now());
            GraphiteState.SuspendReporting(suspension);
            GraphiteState.EnableReporting();

            var result = GraphiteState.IsReportingEnabled();

            Assert.That(result, Is.True);
        }
Exemplo n.º 3
0
        public void IsReportingEnabled_SuspensionEnded_ReturnTrue()
        {
            var now = SystemTime.Now();

            FreezeSystemTime(now);
            const int seconds    = 10;
            var       suspension = TimeSpan.FromSeconds(seconds);

            GraphiteState.SuspendReporting(suspension);
            var futureNow = now.AddSeconds(seconds + 1);

            FreezeSystemTime(futureNow);

            var result = GraphiteState.IsReportingEnabled();

            Assert.That(result, Is.True);
        }
Exemplo n.º 4
0
        public void IsReportingEnabled_SuspensionIsOverButDisabledExplicitly_ReturnFalse()
        {
            var now = SystemTime.Now();

            FreezeSystemTime(now);
            const int seconds    = 10;
            var       suspension = TimeSpan.FromSeconds(seconds);

            GraphiteState.SuspendReporting(suspension);
            var futureNow = now.AddSeconds(seconds + 1);

            FreezeSystemTime(futureNow);
            GraphiteState.DisableReporting();

            var result = GraphiteState.IsReportingEnabled();

            Assert.That(result, Is.False);
        }
Exemplo n.º 5
0
 private static void ResetState()
 {
     GraphiteState.EnableReporting();
 }
Exemplo n.º 6
0
        public void IsReportingEnabled_NoSuspension_ReturnTrue()
        {
            var result = GraphiteState.IsReportingEnabled();

            Assert.That(result, Is.True);
        }