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: Test add and average methods - ASP.NET Core Tutorial
From the course: Advanced ASP.NET Core: Unit Testing
Challenge: Test add and average methods
(upbeat music) - [Instructor] You learned how to pass data to a unit test method using the inline data attribute. We created two unit tests, one for the diff method, and one for the sum method. Now, it's time for you to test your knowledge by testing the add and the average methods. So when we created unit tests with parameters, we first added the theory attribute. And then we added the inline data attribute, where we passed the parameters, and at the end, we tested the result. It's important to know that the numbers of parameters in the inline data attribute need to match the number of parameters in the unit testing method. You'll find my solution on the next video, but please, try it first on your own.
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
-
-
-
-
ASP.NET Core console project overview1m 46s
-
(Locked)
Set up the console testing project5m 20s
-
(Locked)
xUnit Theory with InlineData6m 15s
-
(Locked)
Challenge: Test add and average methods51s
-
(Locked)
Solution: Test add and average methods4m 25s
-
(Locked)
xUnit Theory with MemberData4m 29s
-
(Locked)
xUnit Theory with ClassData4m 7s
-
-
-
-