public void SetsContentTypeHeader(HttpControllerContext context, Model model,
     JSendValueResultConverter<Model> converter)
 {
     // Exercise system
     var message = converter.Convert(context, model);
     // Verify outcome
     message.Content.Headers.ContentType.MediaType.Should().Be("application/json");
 }
 public void StatusCodeIs200(HttpControllerContext context, Model model,
     JSendValueResultConverter<Model> converter)
 {
     // Exercise system
     var message = converter.Convert(context, model);
     // Verify outcome
     message.StatusCode.Should().Be(HttpStatusCode.OK);
 }
Exemplo n.º 3
0
        public void SetsContentTypeHeader(HttpControllerContext context, Model model,
                                          JSendValueResultConverter <Model> converter)
        {
            // Exercise system
            var message = converter.Convert(context, model);

            // Verify outcome
            message.Content.Headers.ContentType.MediaType.Should().Be("application/json");
        }
Exemplo n.º 4
0
        public void StatusCodeIs200(HttpControllerContext context, Model model,
                                    JSendValueResultConverter <Model> converter)
        {
            // Exercise system
            var message = converter.Convert(context, model);

            // Verify outcome
            message.StatusCode.Should().Be(HttpStatusCode.OK);
        }
 public async Task ConvertReturnsSuccessMessage(HttpControllerContext context, Model model,
     JSendValueResultConverter<Model> converter)
 {
     // Fixture setup
     var jsendSuccess = JsonConvert.SerializeObject(new SuccessResponse(model));
     // Exercise system
     var message = converter.Convert(context, model);
     // Verify outcome
     var content = await message.Content.ReadAsStringAsync();
     content.Should().Be(jsendSuccess);
 }
Exemplo n.º 6
0
        public async Task ConvertReturnsSuccessMessage(HttpControllerContext context, Model model,
                                                       JSendValueResultConverter <Model> converter)
        {
            // Fixture setup
            var jsendSuccess = JsonConvert.SerializeObject(new SuccessResponse(model));
            // Exercise system
            var message = converter.Convert(context, model);
            // Verify outcome
            var content = await message.Content.ReadAsStringAsync();

            content.Should().Be(jsendSuccess);
        }
Exemplo n.º 7
0
 public void ThrowsWhenControllerContextIsNull(Model value, JSendValueResultConverter <Model> converter)
 {
     // Exercise system and verify outcome
     Assert.Throws <ArgumentNullException>(() => converter.Convert(null, value));
 }
 public void ThrowsWhenControllerContextIsNull(Model value, JSendValueResultConverter<Model> converter)
 {
     // Exercise system and verify outcome
     Assert.Throws<ArgumentNullException>(() => converter.Convert(null, value));
 }