Loading
Know the answer? Post it. Somebody with the same question will find it here.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend5days leftRegister
Rajesh GamiRank #30 · 41.5K reputationPosted Nov 15, 2022, 8:15 AM EST
https://www.c-sharpcorner.com/article/unit-testing-controllers-in-web-api/
https://learn.microsoft.com/en-us/aspnet/core/mvc/controllers/testing?view=aspnetcore-7.0
https://learn.microsoft.com/en-us/aspnet/web-api/overview/testing-and-debugging/unit-testing-controllers-in-web-api
https://stackoverflow.com/questions/41722191/unit-testing-a-web-api-controller
https://www.youtube.com/watch?v=RgoytbbYbr8
Jignesh KumarRank #91 · 22.9K reputationPosted Nov 14, 2022, 7:01 AM EST
https://www.c-sharpcorner.com/article/unit-testing-controllers-in-web-api/
Sachin SinghRank #66 · 26.2K reputationPosted Nov 14, 2022, 4:32 AM EST
Unit test means testing the last unit of code, So, first test the Business Logic then Moq the Business Logic in Web API and use Assert.Throw to throw exceptions if necessary to validate the exceptions.
Rajanikant HawaldarRank #110 · 20.2K reputationPosted Nov 14, 2022, 4:38 AM EST
https://www.c-sharpcorner.com/UploadFile/pandeypradip/unit-testing-of-web-api/
Brahma Prakash ShuklaRank #633 · 3.8K reputationPosted Nov 14, 2022, 4:44 AM EST
https://learn.microsoft.com/en-us/aspnet/web-api/overview/testing-and-debugging/unit-testing-controllers-in-web-api