public void EndInvokePropagatesThrownException() { MockService service = new MockService(); service.NextException = new ApplicationException(); TypeMethodImpl impl = GetImpl("Erroneous"); IAsyncResult ar = impl.BeginInvoke(service, null, null, null); try { impl.EndInvoke(service, ar); Assert.Fail("Expected " + typeof(TargetMethodException)); } catch (TargetMethodException e) { Assert.IsNotNull(e.InnerException); Assert.AreSame(service.NextException, e.InnerException); } }
public void CannotCallEndInvokeWithNullService() { TypeMethodImpl impl = GetImpl("Sub"); impl.EndInvoke(null, impl.BeginInvoke(new MockService(), null, null, null)); }