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.
Unit testing remove ActionResult - ASP.NET Core Tutorial
From the course: Advanced ASP.NET Core: Unit Testing
Unit testing remove ActionResult
- [Instructor] So far, we have tested features like, listing all books, creating new books, and showing the details of a single book, there is one more feature that we are missing for the unit test project to be completed, and that is deleting a book from the library. So let's go to Visual Studio and see this in action, go to the books controller test, and scroll to the bottom where we are going to create our new test. So in here, I'll just write theory, and then InlineData, because this actual result takes as a parameter, of book ID. So next, that is just write public void DeleteTest. Here we are going to have the string validGuid. And you will see that we get an error because we provided a parameter for the DeleteTest method, but we didn't provide any parameters in the InlineData attribute. So I'll just scroll up in here, go to the DetailsUnitTest, and copy this string value, then scroll down and paste it in here inside brackets,…
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)
-