public DiagnoisticsEventThrottlingManagerTest() { this.throttleFirstCallManager = new DiagnoisticsEventThrottlingManager<DiagnoisticsEventThrottlingMock>( this.throttleAllContainer, this.scheduler, SampleIntervalInMinutes); this.notThrottleManager = new DiagnoisticsEventThrottlingManager<DiagnoisticsEventThrottlingMock>( this.notThrottleContainer, this.scheduler, SampleIntervalInMinutes); this.listener = new DiagnosticsListener(new List<IDiagnosticsSender> { this.sender }); this.listener.LogLevel = EventLevel.Verbose; }
public void TestActionRegisteredAfterInitialization() { var manager = new DiagnoisticsEventThrottlingManager<DiagnoisticsEventThrottlingMock>( this.container, this.scheduler, SampleIntervalInMinutes); Assert.AreEqual(1, this.scheduler.Items.Count, "Unexpected count of registered actions"); var item = this.scheduler.Items.First(); Assert.IsNotNull(item.Action, "Action is not set"); #if NET40 Assert.AreEqual( manager.GetType(), item.Action.Method.DeclaringType, "Unexpected type of method binded with action"); #endif Assert.AreEqual(SampleIntervalInMiliseconds, (uint)item.Interval, "Unexpected interval value"); }