Exemple #1
0
        public void When_the_request_has_no_upstream_header()
        {
            var response = Hydrator.MakeRequest("/candidate/ref/456", new HttpRequestMessage());

            response.StatusCode.ShouldBe(HttpStatusCode.InternalServerError);
            //in-memory doesnt give you the full exception back?
        }
Exemple #2
0
        public void When_requesting_an_invalid_remote_url()
        {
            var response = Hydrator.MakeRequest("some/endpoint/789", BuildMessage(new HttpRequestMessage()));

            response.StatusCode.ShouldBe(HttpStatusCode.NotFound);
            Remote.Recieved.Count().ShouldBe(1);
        }
Exemple #3
0
        public void Without_a_hydrate_header()
        {
            var response = Hydrator.MakeRequest("/candidate/ref/456", BuildMessage(new HttpRequestMessage()));

            var body = response.Content.ReadAsStringAsync().Result;

            body.ShouldNotBeEmpty();
            body.ShouldBe(Resource.PersonWithOneRef);
        }
Exemple #4
0
        public void When_handling_a_delete_with_type_only()
        {
            var response = Hydrator.MakeRequest(
                "/manage/statement",
                new HttpRequestMessage {
                Method = HttpMethod.Delete
            });

            response.StatusCode.ShouldBe(HttpStatusCode.OK);
        }
Exemple #5
0
        public void When_handling_a_post_with_type_id_and_json()
        {
            var response = Hydrator.MakeRequest(
                "/manage/statement/abc",
                new HttpRequestMessage {
                Method = HttpMethod.Post, Content = new StringContent("")
            });

            response.StatusCode.ShouldBe(HttpStatusCode.OK);
        }
Exemple #6
0
        public void When_handling_a_get_with_type_and_id()
        {
            var response = Hydrator.MakeRequest(
                "/manage/statement/abc",
                new HttpRequestMessage {
                Method = HttpMethod.Get
            });

            response.StatusCode.ShouldBe(HttpStatusCode.OK);
        }