Inheritance: IResponseHandler
        public async Task FollowAndApplyInDistinctSteps()
        {
            var link = new Link() {Target = new Uri("http://example.org/")};

            var client = new HttpClient(new FakeHandler() { Response = new HttpResponseMessage()
            {
                StatusCode = HttpStatusCode.NotFound
            } });
            
            var clientState = new ClientApplicationState();

            await client.FollowLinkAsync(link)
                        .ApplyRepresentationToAsync(clientState);

            Assert.Equal(HttpStatusCode.NotFound, clientState.StatusCode);
        }
Example #2
0
        public async Task FollowAndApplyInDistinctSteps()
        {
            var link = new Link()
            {
                Target = new Uri("http://example.org/")
            };

            var client = new HttpClient(new FakeHandler()
            {
                Response = new HttpResponseMessage()
                {
                    StatusCode = HttpStatusCode.NotFound
                }
            });

            var clientState = new ClientApplicationState();

            await client.FollowLinkAsync(link)
            .ApplyRepresentationToAsync(clientState);

            Assert.Equal(HttpStatusCode.NotFound, clientState.StatusCode);
        }