Exemplo n.º 1
0
        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));
        }
Exemplo n.º 2
0
        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);
        }