I want to write unit test for my controller.
I want to check the response codes of actions. For example, Post action should return 201, get should return 200, etc.
However, the Action method return IActionResult. How do I get response code from the ActionResult?
//setup
MyController controller = CreateController<MyController>();
//action
var actionResult = controller.Post(dafXml);
//assert
???
I don't want to check the type of action result since I care only about the status code. for example, 201 can be achieved by CreatedAtAction, CreatedAtRoute or with custom ObjectResult...