public static IEnumerator AddAsync(int a, int b, float delaySeconds) { IAsyncResult ar = TestApi.Begin_AddAsync(Coroutines.AsyncCallback, a, b, delaySeconds); yield return(ar); yield return(Result.New(TestApi.End_AddAsync(ar))); }
IEnumerator TestTooFastCallback() { IAsyncResult ar = TestApi.Begin_TooFastCallback(Coroutines.AsyncCallback, 10); yield return(ar); int res = TestApi.End_TooFastCallback(ar); TestUtil.AssertEq(10, res); }
IEnumerator TestAsyncApi(float delaySeconds) { IAsyncResult ar = TestApi.Begin_AddAsync(Coroutines.AsyncCallback, 3, 5, delaySeconds); yield return(ar); int res = TestApi.End_AddAsync(ar); TestUtil.AssertEq(8, res); }