我们假设这是我的行动方法
public IHttpActionResult Get(int id)
{
var status = GetSomething(id);
if (status)
{
return Ok();
}
else
{
return NotFound();
}
}
Run Code Online (Sandbox Code Playgroud)
测试将是
var httpActionResult = controller.Get(1);
Run Code Online (Sandbox Code Playgroud)
如何在此之后检查我的http状态代码?