protected override Task <HttpResponseMessage> SendAsync(HttpRequestMessage request, CancellationToken cancellationToken) { var args = new FakeSendArgs(request); OnSending(args); if (args.Error != null) { return(Task.FromException <HttpResponseMessage>(args.Error)); } return(Task.FromResult(args.Response)); }
protected virtual void OnSending(FakeSendArgs args) { Sending?.Invoke(this, args); }