24 October 2011
What are .MOLES Files?
at
07:42


After clicking the Add Moles Assembly option, in the Solution Explorer context menu, a file with extension .moles is added to the test project. This file contains an instruction for the compiler, that requests a mole assembly to be generated for the specified assembly. Without these files, no moles assemblies will be generated.
Moles Error Says I Haven't Instrumented a Type. What Does That Mean?
at
07:33


There are three possible causes for instrumentation exceptions:
Using Declarations and Assembly Attributes
You must ensure a MoledType assembly attribute is present, for the type specified by the exception. For example:
Refer to the How Do I Make My Test Use Moles post, for more details.
Mode of Execution
If you are certain you have included all of the required using declarations and assembly attributes, examine your method of execution. Pex and Moles tests require special instructions to be sent to the compiler, to properly route calls through the Moles assembly. Third party test execution utilities, such as CodeRush, do not provide this supplemental information. A missing instrumentation exception will be thrown, when Pex and Moles tests are executed by CodeRush.
Unsupported Test Framework
Pex and Moles support both the Visual Studio and NUnit Test Frameworks. Other frameworks are not supported.
Using Declarations and Assembly Attributes
You must ensure a MoledType assembly attribute is present, for the type specified by the exception. For example:
[assembly: MoledType(typeof(System.IO.File))]
Refer to the How Do I Make My Test Use Moles post, for more details.
Mode of Execution
If you are certain you have included all of the required using declarations and assembly attributes, examine your method of execution. Pex and Moles tests require special instructions to be sent to the compiler, to properly route calls through the Moles assembly. Third party test execution utilities, such as CodeRush, do not provide this supplemental information. A missing instrumentation exception will be thrown, when Pex and Moles tests are executed by CodeRush.
Unsupported Test Framework
Pex and Moles support both the Visual Studio and NUnit Test Frameworks. Other frameworks are not supported.
Why Doesn't the .Moles Assembly Appear in Solution Explorer?
at
07:27


There are two common answers to this question:
- Compile the test project. The moles assemblies are generated on compile.
- Select the project in the Solution Explorer window, and then click the Show All Files button. A hidden folder named MolesAssemblies will appear.
There should be no reason to handle the moles assemblies, since they may be frequently regenerated.
Where Are the Moles Assemblies?
at
07:24


"I compiled my test project, after asking to mole an assembly. I see the .moles file, but where is the moles assembly?"
Moles assemblies are visible in the Solution Explorer window, by clicking the Show All Files button. (Be sure the proper project is selected, first!) All moles assemblies are found in the hidden MolesAssemblies folder.
Moles assemblies are visible in the Solution Explorer window, by clicking the Show All Files button. (Be sure the proper project is selected, first!) All moles assemblies are found in the hidden MolesAssemblies folder.
Subscribe to:
Posts (Atom)