コード例 #1
0
        public void TestDispose()
        {
            var countdownEvent  = new CountdownEvent(2);
            var eventDispatcher = new TestEventDispatcher(countdownEvent);

            SetEventProcessor(eventDispatcher);

            Assert.IsTrue(EventProcessor.IsStarted);

            UserEvent userEvent = BuildConversionEvent(EventName);

            EventProcessor.Process(userEvent);
            eventDispatcher.ExpectConversion(EventName, TestUserId);

            EventProcessor.Dispose();

            Assert.True(eventDispatcher.CompareEvents());

            // make sure, isStarted is false while dispose.
            Assert.False(EventProcessor.IsStarted);
        }