DoSomethingAsync() public method

public DoSomethingAsync ( ) : System.Threading.Tasks.Task
return System.Threading.Tasks.Task
Ejemplo n.º 1
0
        public async Task DoSomethingAsync()
        {
            var handWritten = new HandWritten();
            var proxy       = new HandWrittenProxy(handWritten, new InvocationHandler(async invocation =>
            {
                await Task.Delay(1);
                await invocation.Proceed();
                return(null);
            }));
            await proxy.DoSomethingAsync();

            Assert.IsTrue(handWritten.DoSomethingAsyncCalled);
        }
Ejemplo n.º 2
0
 public async void DoSomethingAsync()
 {
     var handWritten = new HandWritten();
     var proxy = new HandWrittenProxy(handWritten, new InvocationHandler(async invocation =>
     {
         await Task.Delay(1);
         await invocation.Proceed();
         return null;
     }));
     await proxy.DoSomethingAsync();
     Assert.IsTrue(handWritten.DoSomethingAsyncCalled);
 }