Exemplo n.º 1
0
        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));
        }
Exemplo n.º 2
0
 protected virtual void OnSending(FakeSendArgs args)
 {
     Sending?.Invoke(this, args);
 }