hi,
I am testing existing MVC application, in that they are using private methods, now I need to test those methods using Nunit test, I can't change the code. how to do that.
Thanks
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
Gowtham KRank #65 · 26.5K reputationPosted Apr 25, 2016, 5:47 PM EDT
Munesh SharmaRank #174 · 13.9K reputationPosted May 2, 2016, 10:29 AM EDT
Generally, unit testing addresses a class's public interface, on the theory that the implementation is immaterial, so long as the results are correct from the client's point of view.
So, NUnit does not provide any mechanism for testing non-public members.
Sridhar YelagandhulaRank #1,799 · 828 reputationPosted Jan 14, 2020, 8:18 PM EST