예제 #1
0
        public void Test2_Code400_WhenEmptyContent()
        {
            var request = new HttpRequestMessage();

            request.Method     = HttpMethod.Post;
            request.RequestUri = BuildUsersUri();
            request.Headers.Add("Accept", "*/*");
            request.AddEmptyContent("application/json; charset=utf-8");
            var response = httpClient.Send(request);

            response.StatusCode.Should().Be(HttpStatusCode.BadRequest);
            response.ShouldNotHaveHeader("Content-Type");
        }
        public void Test4_Code400_WhenEmptyContent()
        {
            var updatingUserId = Guid.NewGuid().ToString();

            var request = new HttpRequestMessage();

            request.Method     = HttpMethod.Patch;
            request.RequestUri = BuildUsersByIdUri(updatingUserId);
            request.Headers.Add("Accept", "*/*");
            request.AddEmptyContent("application/json-patch+json");
            var response = httpClient.Send(request);

            response.StatusCode.Should().Be(HttpStatusCode.BadRequest);
            response.ShouldNotHaveHeader("Content-Type");
        }