Fix flaky NoContentFormatter test

This commit is contained in:
Ryan Nowak 2014-11-20 17:47:22 -08:00
parent d9893b260a
commit eb6598e1b9
2 changed files with 4 additions and 4 deletions

View File

@ -104,8 +104,7 @@ namespace Microsoft.AspNet.Mvc.FunctionalTests
// Assert
Assert.Equal(HttpStatusCode.NoContent, response.StatusCode);
var body = await response.Content.ReadAsStringAsync();
Assert.Equal("Hello world", body);
Assert.Equal("Hello, World!", Assert.Single(response.Headers.GetValues("Message")));
}
[Fact]

View File

@ -48,9 +48,10 @@ namespace BasicWebSite.Controllers
return new HttpStatusCodeResult(200);
}
public async Task ActionReturningTask()
public Task ActionReturningTask()
{
await Context.Response.WriteAsync("Hello world");
Response.Headers.Add("Message", new[] { "Hello, World!" });
return Task.FromResult(true);
}
public IActionResult JsonTextInView()