Exemplo n.º 1
0
        public void AsyncLocalCheckIn_GivesGoodResult()
        {
            SyncResults result     = null;
            var         waitHandle = new AutoResetEvent(false);

            _model.AsyncLocalCheckIn("testing", r => { result = r; waitHandle.Set(); });
            WaitForTasksToFinish(1, waitHandle);
            Assert.That(result.Succeeded, Is.True);
        }
Exemplo n.º 2
0
 public void AsyncLocalCheckIn_GivesGoodResult()
 {
     SyncResults result=null;
     _model.AsyncLocalCheckIn("testing", (r)=>result=r);
     var start = DateTime.Now;
     while (result == null)
     {
         Thread.Sleep(100);
         Application.DoEvents();//without this, the background worker starves 'cause their's no UI
         if ((DateTime.Now.Subtract(start).Minutes > 0))
         {
             Assert.Fail("Gave up waiting.");
         }
     }
     Assert.IsTrue(result.Succeeded);
 }