Пример #1
0
        private ThresholdReactor GetThresholdReactor(int threshold, bool resetOnThresholdReached = true)
        {
            var sut = new ThresholdReactor()
            {
                EventsInWindowThreshold = threshold,
                ThresholdName           = Guid.NewGuid().ToString(),
                WindowSeconds           = 120,
                ResetOnThresholdReached = resetOnThresholdReached
            };

            var appHost = new Mock <IAppHost>();

            appHost.SetupGet(h => h.Host).Returns(new Host(new[] { "localhost" }, "test"));
            appHost.SetupGet(h => h.Logger).Returns(_logger.Object);

            sut.Attach(appHost.Object);

            return(sut);
        }
Пример #2
0
        private ThresholdReactor GetThresholdReactor(int threshold, bool resetOnThresholdReached = true)
        {
            var sut = new ThresholdReactor()
                {
                    EventsInWindowThreshold = threshold,
                    ThresholdName = Guid.NewGuid().ToString(),
                    WindowSeconds = 120,
                    ResetOnThresholdReached = resetOnThresholdReached
                };

            var appHost = new Mock<IAppHost>();
            appHost.SetupGet(h => h.Host).Returns(new Host(new[] { "localhost" }, "test"));
            appHost.SetupGet(h => h.Logger).Returns(_logger.Object);

            sut.Attach(appHost.Object);

            return sut;
        }