public void when_started_events_are_bookmarked()
        {
            var resetEvent = new ManualResetEventSlim();
            var sender     = new FakeTelemetrySender();
            var bookmarker = new FakeBookmarker(() => resetEvent.Set());

            var sut = new WindowsEventLogPoller("Application", sender, bookmarker);

            sut.Start();

            resetEvent.Wait(TimeSpan.FromSeconds(10));
            Assert.NotNull(bookmarker.GetLatest("Application"));
        }
        public void when_started_events_are_streamed_to_the_telemetry_sender()
        {
            TraceTelemetry capturedEvent = null;
            var            resetEvent    = new ManualResetEventSlim();
            var            sender        = new FakeTelemetrySender(e =>
            {
                capturedEvent = e;
                resetEvent.Set();
            });

            var sut = new WindowsEventLogPoller("Application", sender, new FakeBookmarker());

            sut.Start();

            resetEvent.Wait(TimeSpan.FromSeconds(1));
            Assert.NotNull(capturedEvent);
        }