public async Task <T> SendRequestAsync <T>(Uri serverUri, SeafRequest <T> request)
        {
            HttpResponseMessage response;

            if (!_responseCache.TryGetValue(request.GetType(), out response))
            {
                throw new Exception("No mocked response for the request available.");
            }

            if (request.WasSuccessful(response))
            {
                return(await request.ParseResponseAsync(response));
            }

            throw new SeafException(request.GetSeafError(response));
        }
 public async Task <T> SendRequestAsync <T>(Uri serverUri, SeafRequest <T> request, TimeSpan?timeout)
 {
     // timeout is not supported
     return(await SendRequestAsync(serverUri, request));
 }