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."); } }
internal void VariableCallTest(int length) { for (int i = 0; i < length; i++) { Client1.Call <ITestInterface>(Client2.Id).VariableParametersTest(new object[] { a, b, c }); } }
internal void SimpleCallTest(int length) { for (int i = 0; i < length; i++) { Client1.Call <ITestInterface>(Client2.Id).SimpleMethod(a, b, c); } }
// 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(); }
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. } }