public override Task WriteAsync(char[] buffer, int index, int count) { Write(buffer, index, count); return Task.CompletedTask; }
public async void WithProxy() { var writer = new StringWriter(); var printer = Proxy.CreateProxy<HelloWorldPrinter>(async invocation => { await writer.WriteAsync("John says, \""); await invocation.Proceed(); await writer.WriteAsync("\""); return null; }); await printer.SayHello(writer); Assert.AreEqual("John says, \"Hello World!\"", writer.ToString()); }