How to write unit test for private method in c# using moq framework?
You can’t, at least not with Moq. But more importantly, you shouldn’t. First off, you don’t test methods, you test behaviours. Second, in order to test behaviours, you exercise a type’s public API and verify the outcomes of that exercise. Private methods are implementation details. You don’t want to verify how things get done, you … Read more