From the course: Advanced ASP.NET Core: Unit Testing

Unlock the full course today

Join today to access over 22,600 courses taught by industry experts or purchase this course individually.

Challenge: Unit testing details ActionResult

Challenge: Unit testing details ActionResult - ASP.NET Core Tutorial

From the course: Advanced ASP.NET Core: Unit Testing

Start my 1-month free trial

Challenge: Unit testing details ActionResult

(upbeat music) - [Instructor] You learned how to unit test an action result in a controller. We did not pass any parameters of the unit test, but you learned how to unit test the expected return type and the return data. Now, it's time for you to test your knowledge by unit testing the details action result. Now, say the details action result takes a parameter. You can either use the fact attribute and provide the parameters inside the method, or you can use the theory attribute and pass the parameters using the inline data attribute. And I highly recommend you use the second one. So, you need to add a theory attribute, then the inline data attribute where you pass the data and then test the results.

Contents