Beispiel #1
0
        internal void AsyncResultCallTest()
        {
            ManualResetEvent eventa = new ManualResetEvent(false);

            AsyncCallResultDelegate delegateInstance =
                delegate(ISuperPoolClient client, AsyncResultParams parameters)
            {
                if ((parameters.State is int == false) ||
                    (int)parameters.State != 152)
                {
                    Assert.Fail("Parameter fail.");
                }

                if (parameters.Result != null)
                {
                    // Do something with result.
                    string resultString = parameters.Result.ToString();
                }

                eventa.Set();
            };

            Client1.Call <ITestInterface>(Client2.Id, delegateInstance, 152).AsyncResultMethod(1500);

            if (eventa.WaitOne(60000) == false)
            {
                Assert.Fail("Failed to receive async result.");
            }
        }
Beispiel #2
0
 internal void VariableCallTest(int length)
 {
     for (int i = 0; i < length; i++)
     {
         Client1.Call <ITestInterface>(Client2.Id).VariableParametersTest(new object[] { a, b, c });
     }
 }
Beispiel #3
0
 internal void SimpleCallTest(int length)
 {
     for (int i = 0; i < length; i++)
     {
         Client1.Call <ITestInterface>(Client2.Id).SimpleMethod(a, b, c);
     }
 }
Beispiel #4
0
    // Use this for initialization
    void Start()
    {
        IClient   client   = new Client1();
        IFunction function = new Function2();

        client.SetFunction(function);
        function.SetClient(client);
        client.mStr = "xxxx";
        client.Call();
    }
Beispiel #5
0
 internal void OutCallTest()
 {
     try
     {
         int d = 0;
         Client1.Call <ITestInterface>(Client2.Id).OutMethod(out d);
         throw new Exception("Invalid call did not generate expected exception.");
     }
     catch (NotImplementedException)
     {
         // Test succeded only if exception is thrown.
     }
 }