public async Task SumAsync() { var handWritten = new HandWritten(); var proxy = new HandWrittenProxy(handWritten, new InvocationHandler(async invocation => { var value = (int)await invocation.Proceed(); return(value + 3); })); var result = await proxy.SumAsync(1, 2); Assert.AreEqual(6, result); }
public async void SumAsync() { var handWritten = new HandWritten(); var proxy = new HandWrittenProxy(handWritten, new InvocationHandler(async invocation => { var value = (int)await invocation.Proceed(); return value + 3; })); var result = await proxy.SumAsync(1, 2); Assert.AreEqual(6, result); }