Ejemplo n.º 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?
        }
Ejemplo n.º 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);
        }
Ejemplo n.º 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);
        }
Ejemplo n.º 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);
        }
Ejemplo n.º 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);
        }
Ejemplo n.º 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);
        }