public async Task Request() { _vineClient.EnsureResponseSuccess = false; DoesNotThrowAsync(async() => await _vineClient.Request <Empty>("some/url"), "Request returns a response."); DoesNotThrowAsync(async() => await _vineClient.Request <Empty>("some/url2"), "Request returns an error."); _vineClient.EnsureResponseSuccess = true; ThrowsAsync <VineClientException>(async() => await _vineClient.Request <Empty>("some/url2")); try { await _vineClient.Request <Empty>("some/url2"); } catch (VineClientException ex) { IsTrue(ex.Message == "Error 900: That record does not exist.", "ex.Message == 'Error 900: That record does not exist.'"); } }
internal async Task <Response <T> > Request <T>(string methodName, string reqType = "get", MethodParams methodParams = null) => await _apiClient.Request <T>(_methodsGroup + (string.IsNullOrEmpty(methodName) ? "" : "/" + methodName), reqType, methodParams);