O'Reilly logo

Windows® Phone 8 Unleashed by Daniel Vaughan

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Testing Nonpublic Members

Sometimes you need to test classes and members that are not public but are internal to a project, such as during system testing, where you need to interact with UI elements directly. To have access to internal members, you must allow the test project access to the internal members of the main project. You do this by placing an InternalsVisibleTo attribute into the AssemblyInfo class of the main project, as shown:

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

The InternalsVisibleTo attribute accepts a single parameter, which is the name of the assembly. If the test project has a strong name, the full name of the assembly must be used, including its public key token.

Examples of the InternalsVisibleTo attribute are ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required