Пример #1
0
        public void NoEventsAreExtractedFromAnEmptyCache()
        {
            var extraxtedRelicInsightsEvents =
                NewRelicInsightsEventExtractor.ExtractNewRelicInsightsEvents(
                    new ConcurrentQueue <NewRelicInsightsEvent>(), 1000);

            Assert.AreEqual(0, extraxtedRelicInsightsEvents.Count());
        }
Пример #2
0
        public void AllEventsAreExtractedFromASmallCache()
        {
            var cache = new ConcurrentQueue <NewRelicInsightsEvent>();

            for (var i = 0; i < 999; i++)
            {
                cache.Enqueue(new DummyNewRelicInsightsEvent());
            }

            var extraxtedRelicInsightsEvents =
                NewRelicInsightsEventExtractor.ExtractNewRelicInsightsEvents(cache, 1000);

            Assert.AreEqual(999, extraxtedRelicInsightsEvents.Count());
        }
Пример #3
0
        public void MaximumEventsAreExtractedFromALargeCache()
        {
            var cache = new ConcurrentQueue <NewRelicInsightsEvent>();

            for (var i = 0; i < 1001; i++)
            {
                cache.Enqueue(new DummyNewRelicInsightsEvent());
            }

            var extraxtedRelicInsightsEvents =
                NewRelicInsightsEventExtractor.ExtractNewRelicInsightsEvents(cache, 1000);

            Assert.AreEqual(1000, extraxtedRelicInsightsEvents.Count());
        }