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

            proxy.EndGetStateName(asr2).ShouldBe("Alabama");
        }
예제 #2
0
        public void MakeAsynchronousCallWait()
        {
            var proxy = new StateName();
            var asr2  = proxy.BeginGetStateName(1);

            asr2.AsyncWaitHandle.WaitOne();

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

            proxy.EndGetStateName(asr1).ShouldBe("Alabama");
        }
예제 #4
0
        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");
        }
예제 #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");
        }
예제 #6
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");
        }
예제 #7
0
        public void MakeAsynchronousCallIsCompleted()
        {
            var proxy = new StateName();
            var asr1  = proxy.BeginGetStateName(1);

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

            proxy.EndGetStateName(asr1).ShouldBe("Alabama");
        }
예제 #8
0
        public void MakeSystemListMethodsCall()
        {
            var proxy = new StateName();

            proxy
            .SystemListMethods()
            .ShouldBe(new []
            {
                "examples.getStateName",
                "examples.getStateNameFromString",
                "examples.getStateNameStruct",
                "examples.getStateStruct"
            });
        }
예제 #9
0
        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"));
        }
예제 #10
0
        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"));
        }
예제 #11
0
 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);
 }
예제 #12
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);
 }
예제 #13
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);
 }
예제 #14
0
 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");
 }
예제 #15
0
 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);
 }
예제 #16
0
 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");
 }
예제 #17
0
 public void MakeSystemListMethodsCall()
 {
     var proxy = new StateName();
     proxy
         .SystemListMethods()
         .ShouldBe(new []
         {
             "examples.getStateName",
             "examples.getStateNameFromString",
             "examples.getStateNameStruct",
             "examples.getStateStruct"
         });
 }
예제 #18
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);
 }