public void TestInterceptFuncDelegateNoException() { Func <int> interceptedFunc = UnaryRpcInterceptor.Intercept(returnIntFunc); Assert.DoesNotThrow(delegate() { interceptedFunc(); }); }
public void TestInterceptTaskNoException() { Task <int> interceptedTask = UnaryRpcInterceptor.Intercept(Task.Run(returnIntFunc)); Assert.DoesNotThrow(delegate() { interceptedTask.Wait(); }); }
public void TestInterceptActionNoException() { Action interceptedAction = UnaryRpcInterceptor.Intercept(returnAction); Assert.DoesNotThrow(delegate() { interceptedAction(); }); }
public void TestInterceptTaskWithException() { Task <int> interceptedTask = UnaryRpcInterceptor.Intercept <int, HelloException>( Task.Run(throwExceptionFunc)); try { interceptedTask.Wait(); } catch (AggregateException ae) { CheckForHelloException(ae); } }
public void TestInterceptActionWithException() { Action interceptedTask = UnaryRpcInterceptor.Intercept(throwExceptionAction); try { interceptedTask(); } catch (GoogleAdsException) { Assert.Pass("Exception parsed correctly."); } catch { Assert.Pass("Exception could not be parsed."); } }
public void TestInterceptFuncDelegateWithException() { Func <int> interceptedFunc = UnaryRpcInterceptor.Intercept(throwExceptionFunc); try { interceptedFunc(); } catch (GoogleAdsException) { Assert.Pass("Exception parsed correctly."); } catch { Assert.Pass("Exception could not be parsed."); } }