public void MakeAsynchronousCallWait() { var proxy = new StateName(); var asr2 = proxy.BeginGetStateName(1); asr2.AsyncWaitHandle.WaitOne(); proxy.EndGetStateName(asr2).ShouldBe("Alabama"); }
public void MakeAsynchronousCallIsCompleted() { var proxy = new StateName(); var asr1 = proxy.BeginGetStateName(1); while (!asr1.IsCompleted) Thread.Sleep(10); proxy.EndGetStateName(asr1).ShouldBe("Alabama"); }
public void MakeAsynchronousCallIsCompleted() { var proxy = new StateName(); var asr1 = proxy.BeginGetStateName(1); while (!asr1.IsCompleted) { Thread.Sleep(10); } proxy.EndGetStateName(asr1).ShouldBe("Alabama"); }
public void MakeAsynchronousCallWait() { StateName proxy = new StateName(); IAsyncResult asr2 = proxy.BeginGetStateName(1); asr2.AsyncWaitHandle.WaitOne(); string ret2 = proxy.EndGetStateName(asr2); Assert.AreEqual("Alabama", ret2); }
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); }