public async Task <WebCallResponse> ActualCall_Test(WebCallRequest wcr) { CallsMade++; LastUsedVerb = wcr.Verb.Method; LastUsedBody = wcr.Body; var result = new WebCallResponse { Status = responseCode }; return(await Task.FromResult <WebCallResponse>(result)); }
public void Response_Non200_SetsSuccessFalse() { var sut = new WebCallResponse(); foreach (var f in Enum.GetValues(typeof(HttpStatusCode))) { var nextCode = (HttpStatusCode)f; sut.Status = nextCode; if (nextCode == HttpStatusCode.OK) { Assert.True(sut.Success); } else { Assert.False(sut.Success); } } Assert.False(sut.Success); }