Esempio n. 1
0
 public void TestAsyncCallInParallel() {
     System.Boolean arg = true;
     TestNegateBooleanDelegate nbd = new TestNegateBooleanDelegate(m_testService.TestNegateBoolean);
     IAsyncResult[] callResults = new IAsyncResult[50];
     // async calls
     for (int i = 0; i < callResults.Length; i++) {
         callResults[i] = nbd.BeginInvoke(arg, null, null);
     }
     // wait for responses
     for (int i = 0; i < callResults.Length; i++) {
         System.Boolean result = nbd.EndInvoke(callResults[i]);
         Assertion.AssertEquals(false, result);
     }
 }
Esempio n. 2
0
 public void TestAsyncCall() {
     System.Boolean arg = true;
     TestNegateBooleanDelegate nbd = new TestNegateBooleanDelegate(m_testService.TestNegateBoolean);
     // async call
     IAsyncResult ar = nbd.BeginInvoke(arg, null, null);
     // wait for response
     System.Boolean result = nbd.EndInvoke(ar);
     Assertion.AssertEquals(false, result);
 }