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

Challenge: Test add and average methods - ASP.NET Core Tutorial

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

Start my 1-month free trial

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.

Contents