My Technical Notes

Thursday, 28 January 2016

MsTest: Testing private methods

A few years ago, MsTest had the Private Accessor feature, but it has been deprecated.

The apparent solution now is to use the `InternalsVisibleToAttribute` within your application code assembly:


[assembly: InternalsVisibleTo("MyProject.Tests")]

After this, all our `internal` methods will be visible to the `MyProject.Tests` assembly.

No comments: