public void ReasonIsCorrectlyInitialized(string reason, ApiController controller)
 {
     // Exercise system
     var result = new JSendBadRequestResult(reason, controller);
     // Verify outcome
     result.Reason.Should().Be(reason);
 }
Example #2
0
        public void ReasonIsCorrectlyInitialized(string reason, ApiController controller)
        {
            // Exercise system
            var result = new JSendBadRequestResult(reason, controller);

            // Verify outcome
            result.Reason.Should().Be(reason);
        }
Example #3
0
        public async Task SetsContentTypeHeader(JSendBadRequestResult result)
        {
            // Exercise system
            var message = await result.ExecuteAsync(new CancellationToken());

            // Verify outcome
            message.Content.Headers.ContentType.MediaType.Should().Be("application/json");
        }
Example #4
0
        public async Task SetsStatusCode(JSendBadRequestResult result)
        {
            // Exercise system
            var message = await result.ExecuteAsync(new CancellationToken());

            // Verify outcome
            message.StatusCode.Should().Be(result.StatusCode);
        }
 public void ResponseIsCorrectlyInitialized(string reason, ApiController controller)
 {
     // Fixture setup
     var expectedResponse = new FailResponse(reason);
     // Exercise system
     var result = new JSendBadRequestResult(reason, controller);
     // Verify outcome
     result.Response.ShouldBeEquivalentTo(expectedResponse);
 }
Example #6
0
        public void ResponseIsCorrectlyInitialized(string reason, ApiController controller)
        {
            // Fixture setup
            var expectedResponse = new FailResponse(reason);
            // Exercise system
            var result = new JSendBadRequestResult(reason, controller);

            // Verify outcome
            result.Response.ShouldBeEquivalentTo(expectedResponse);
        }
Example #7
0
        public async Task ResponseIsSerializedIntoBody(JSendBadRequestResult result)
        {
            // Fixture setup
            var serializedResponse = JsonConvert.SerializeObject(result.Response);
            // Exercise system
            var httpResponse = await result.ExecuteAsync(new CancellationToken());

            // Verify outcome
            var content = await httpResponse.Content.ReadAsStringAsync();

            content.Should().Be(serializedResponse);
        }
 public async Task ResponseIsSerializedIntoBody(JSendBadRequestResult result)
 {
     // Fixture setup
     var serializedResponse = JsonConvert.SerializeObject(result.Response);
     // Exercise system
     var httpResponseMessage = await result.ExecuteAsync(new CancellationToken());
     // Verify outcome
     var content = await httpResponseMessage.Content.ReadAsStringAsync();
     content.Should().Be(serializedResponse);
 }
 public void StatusCodeIs400(JSendBadRequestResult result)
 {
     // Exercise system and verify outcome
     result.StatusCode.Should().Be(HttpStatusCode.BadRequest);
 }
 public void IsHttpActionResult(JSendBadRequestResult result)
 {
     // Exercise system and verify outcome
     result.Should().BeAssignableTo<IHttpActionResult>();
 }
 public async Task SetsContentTypeHeader(JSendBadRequestResult result)
 {
     // Exercise system
     var message = await result.ExecuteAsync(new CancellationToken());
     // Verify outcome
     message.Content.Headers.ContentType.MediaType.Should().Be("application/json");
 }
 public async Task SetsStatusCode(JSendBadRequestResult result)
 {
     // Exercise system
     var message = await result.ExecuteAsync(new CancellationToken());
     // Verify outcome
     message.StatusCode.Should().Be(result.StatusCode);
 }
Example #13
0
 public void StatusCodeIs400(JSendBadRequestResult result)
 {
     // Exercise system and verify outcome
     result.StatusCode.Should().Be(HttpStatusCode.BadRequest);
 }
Example #14
0
 public void IsHttpActionResult(JSendBadRequestResult result)
 {
     // Exercise system and verify outcome
     result.Should().BeAssignableTo <IHttpActionResult>();
 }