GetStringAsync() public method

public GetStringAsync ( ) : Task
return Task
Ejemplo n.º 1
0
 public async void GetStringAsync()
 {
     var handWritten = new HandWritten();
     var proxy = new HandWrittenProxy(handWritten, new InvocationHandler(async invocation =>
     {
         await Task.Delay(1);
         var returnValue = await invocation.Proceed();
         return (string)returnValue + "test";
     }));
     var result = await proxy.GetStringAsync();
     Assert.AreEqual(HandWritten.GetStringAsyncReturnValue + "test", result);
 }
Ejemplo n.º 2
0
        public async void GetStringAsync()
        {
            var handWritten = new HandWritten();
            var proxy       = new HandWrittenProxy(handWritten, new InvocationHandler(async invocation =>
            {
                await Task.Delay(1);
                var returnValue = await invocation.Proceed();
                return((string)returnValue + "test");
            }));
            var result = await proxy.GetStringAsync();

            Assert.AreEqual(HandWritten.GetStringAsyncReturnValue + "test", result);
        }