public async Task TestThrowInSubTask() { var obj = new ThrowExceptionTester(); var proxy = ProxyGenerator.CreateClassProxy <ThrowExceptionTester>(); Assert.True(proxy.IsProxy()); await AssertSameThrowsAsync( async() => await obj.ThrowInSubTask(), async() => await proxy.ThrowInSubTask()); }
public async Task TestThrowInUncontinuedTasks() { var obj = new ThrowExceptionTester(); var proxy = ProxyGenerator.CreateClassProxy <ThrowExceptionTester>(); Assert.True(proxy.IsProxy()); // todo re-test // await AssertSameThrowsAsync( // async () => await obj.ThrowInUncontinuedTasks(), // async () => await proxy.ThrowInUncontinuedTasks()); }
public async Task TestThrowException() { var obj = new ThrowExceptionTester(); var proxy = ProxyGenerator.CreateClassProxy <ThrowExceptionTester>(); Assert.True(proxy.IsProxy()); AssertSameThrows( () => obj.ThrowOfResult(), () => proxy.ThrowOfResult()); await AssertSameThrowsAsync( async() => await obj.ThrowAsyncOfTaskResult(), async() => await proxy.ThrowAsyncOfTaskResult()); await AssertSameThrowsAsync( async() => await obj.ThrowAsyncOfValueTask(), async() => await proxy.ThrowAsyncOfValueTask()); }