I want to use Pex and Moles in my project.I want to test Private method using Pex.
Is anyone used Pex to test private method?
If we can't test directly, Is there any workaround to test Private method?
I want to use Pex and Moles in my project.I want to test Private method using Pex.
Is anyone used Pex to test private method?
If we can't test directly, Is there any workaround to test Private method?
This has been answered by Peli, one of Pex's authors: PEX will not work for private and protected methods and workaround pex internal class.
A few of the alternatives:
InternalsVisibleToAttribute
. Put [assembly: InternalsVisibleTo("Company.Product.ProjectUnderTest.Tests")]
into Company.Product.ProjectUnderTest\Properties\AssemblyInfo.cs
.testing .net