If I try this, I just get an exception:
System.TypeLoadException : Access is denied: 'Namespace.IInternalInterface'.
Making the interface public is not an acceptable solution. I don’t want to change the visiblity of my API in order to test it.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
I found the answer to this:
NMock2, (and other mocking frameworks). Will create the mock objects in dynamically generated assemblies. In order for the mocking framework to create the mock object, the internals should be visible to these assemblies.
Just add the following declarations to the AssemblyInfo.cs class for the Module Under Test: