BeginGetStateName() private method

private BeginGetStateName ( int stateNumber ) : IAsyncResult
stateNumber int
return IAsyncResult
Exemplo n.º 1
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);
        }
Exemplo n.º 2
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);
        }
Exemplo n.º 3
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);
        }