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 MakeSynchronousCalls() { var proxy = new StateName(); proxy.GetStateNameUsingMethodName(1).ShouldBe("Alabama"); proxy.GetStateNameUsingMethodInfo(1).ShouldBe("Alabama"); proxy.GetStateNameUsingMethodName("1").ShouldBe("Alabama"); proxy.GetStateNameUsingMethodInfo("1").ShouldBe("Alabama"); }
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"); }
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 MakeSystemListMethodsCall() { var proxy = new StateName(); proxy .SystemListMethods() .ShouldBe(new [] { "examples.getStateName", "examples.getStateNameFromString", "examples.getStateNameStruct", "examples.getStateStruct" }); }
public void AsynchronousCallBackReturningStruct() { var proxy = new StateName(); var asr = proxy.BeginGetStateNameStruct( new StateStructRequest { state1 = 1, state2 = 2, state3 = 3, }, null, null); asr.AsyncWaitHandle.WaitOne(); var response = proxy.EndGetStateNameStruct(asr); response.ShouldSatisfyAllConditions( () => response.stateName1.ShouldBe("Alabama"), () => response.stateName2.ShouldBe("Alaska"), () => response.stateName3.ShouldBe("Arizona")); }
public void MakeSynchronousCalls() { StateName proxy = new StateName(); string ret1 = proxy.GetStateNameUsingMethodName(1); Assert.AreEqual("Alabama", ret1); string ret2 = proxy.GetStateNameUsingMethodInfo(1); Assert.AreEqual("Alabama", ret2); string ret3 = proxy.GetStateNameUsingMethodName("1"); Assert.AreEqual("Alabama", ret3); string ret4 = proxy.GetStateNameUsingMethodInfo("1"); Assert.AreEqual("Alabama", ret4); }
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 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); }
public void MakeSystemListMethodsCall() { StateName proxy = new StateName(); string[] ret = proxy.SystemListMethods(); Assert.AreEqual(3, ret.Length); Assert.AreEqual(ret[0], "examples.getStateName"); Assert.AreEqual(ret[1], "examples.getStateNameFromString"); Assert.AreEqual(ret[2], "examples.getStateStruct"); }
public void AsynchronousCallBackReturningStruct() { StateName proxy = new StateName(); IAsyncResult asr = proxy.BeginGetStateNameStruct(new StateStructRequest { state1 = 1, state2 = 2, state3 = 3, }, null, null); asr.AsyncWaitHandle.WaitOne(); StateStructResponse response = proxy.EndGetStateNameStruct(asr); Assert.AreEqual("Alabama", response.stateName1); Assert.AreEqual("Alaska", response.stateName2); Assert.AreEqual("Arizona", response.stateName3); }
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); }