ALE.Tests.EventLoop_Tests.EventLoop_Stop C# (CSharp) Méthode

EventLoop_Stop() private méthode

private EventLoop_Stop ( ) : void
Résultat void
        public void EventLoop_Stop()
        {
            var wait = new AutoResetEvent(false);
            EventLoop.Start();
            const int loops = 10;
            for (int i = 0; i < loops; i++)
            {
                var x = i;
                EventLoop.Pend(() =>
                                   {
                                       Thread.Sleep(100);
                                       if (x == loops - 1)
                                       {
                                           wait.Set();
                                       }
                                   });

            }
            EventLoop.Stop();
            if (wait.WaitOne(1200))
            {
                Assert.Fail("EventLoop did not stop.");
            }
        }