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 - ASP.NET Core Tutorial
From the course: Advanced ASP.NET Core: Unit Testing
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.
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.
Contents
-
-
-
-
-
-
(Locked)
ASP.NET Core MVC project overview5m
-
(Locked)
Set up MVC testing project2m 34s
-
(Locked)
Unit testing index ActionResult7m 55s
-
(Locked)
Challenge: Unit testing details ActionResult54s
-
(Locked)
Solution: Unit testing details ActionResult9m 54s
-
(Locked)
Unit testing create ActionResult7m 45s
-
(Locked)
Unit testing remove ActionResult5m 30s
-
(Locked)
-