Exemple #1
0
        public void MakeAsynchronousCallWait()
        {
            var proxy = new StateName();
            var asr2 = proxy.BeginGetStateName(1);
            asr2.AsyncWaitHandle.WaitOne();

            proxy.EndGetStateName(asr2).ShouldBe("Alabama");
        }
Exemple #2
0
        public void MakeAsynchronousCallIsCompleted()
        {
            var proxy = new StateName();
            var asr1 = proxy.BeginGetStateName(1);
            while (!asr1.IsCompleted)
                Thread.Sleep(10);

            proxy.EndGetStateName(asr1).ShouldBe("Alabama");
        }
Exemple #3
0
        public void MakeAsynchronousCallWait()
        {
            var proxy = new StateName();
            var asr2  = proxy.BeginGetStateName(1);

            asr2.AsyncWaitHandle.WaitOne();

            proxy.EndGetStateName(asr2).ShouldBe("Alabama");
        }
Exemple #4
0
        public void MakeAsynchronousCallCallBack()
        {
            var proxy = new StateName();
            var evt = new ManualResetEvent(false);
            var info = new CBInfo(evt);
            proxy.BeginGetStateName(1, StateNameCallback, info);

            evt.WaitOne();
            info._excep.ShouldBeNull();
            info._ret.ShouldBe("Alabama");
        }
Exemple #5
0
        public void MakeAsynchronousCallCallBack()
        {
            var proxy = new StateName();
            var evt   = new ManualResetEvent(false);
            var info  = new CBInfo(evt);

            proxy.BeginGetStateName(1, StateNameCallback, info);

            evt.WaitOne();
            info._excep.ShouldBeNull();
            info._ret.ShouldBe("Alabama");
        }
Exemple #6
0
        public void MakeAsynchronousCallIsCompleted()
        {
            var proxy = new StateName();
            var asr1  = proxy.BeginGetStateName(1);

            while (!asr1.IsCompleted)
            {
                Thread.Sleep(10);
            }

            proxy.EndGetStateName(asr1).ShouldBe("Alabama");
        }
Exemple #7
0
 public void MakeAsynchronousCallWait()
 {
     StateName proxy = new StateName();
       IAsyncResult asr2 = proxy.BeginGetStateName(1);
       asr2.AsyncWaitHandle.WaitOne();
       string ret2 = proxy.EndGetStateName(asr2);
       Assert.AreEqual("Alabama", ret2);
 }
Exemple #8
0
 public void MakeAsynchronousCallIsCompleted()
 {
     StateName proxy = new StateName() ;
       IAsyncResult asr1 = proxy.BeginGetStateName(1);
       while (asr1.IsCompleted == false)
     System.Threading.Thread.Sleep(10);
       string ret1 = proxy.EndGetStateName(asr1);
       Assert.AreEqual("Alabama", ret1);
 }
Exemple #9
0
 public void MakeAsynchronousCallCallBack()
 {
     StateName proxy = new StateName();
       ManualResetEvent evt = new ManualResetEvent(false);
       CBInfo info = new CBInfo(evt);
       IAsyncResult asr3 = proxy.BeginGetStateName(1, StateNameCallback, info);
       evt.WaitOne();
       Assert.AreEqual(null, info._excep, "Async call threw exception");
       Assert.AreEqual("Alabama", info._ret);
 }