Visual Studio 2015 RC Pex creates tests for public methods only

125 views Asked by At

I was under the impression that once I have the entry below in my assemblyinfo.cs file

[assembly: InternalsVisibleTo("MyAssembliesName")]

, then pex should be able to see all internal methods in my class definition, in addition to the public methods. So, when does Pex not creat unit tests for the internal methods in my class?

2

There are 2 answers

0
pvlakshm On

The RC version does not yet support exploring non-publicly accessible methods. However, we are addressing this in the next upcoming release. Thank you for your interest in IntelliTest!

0
forsvarir On

The InternalsVisibleTo specifies which assembly you're granting access to, not the assembly that is granting the access (which is what you appear to be describing).

So, if you had a production project and a test project, the production project would have the attribute, granting access to the test project.

I haven't used pex with VS2015, but on the face of it, based on this and this, having the InternalsVisibleTo point at your test project should be enough.