11 August 2011

Pex and Moles DevExpress CodeRush Templates

CodeRush Xpress (or with RefactorPro), from DevExpress, is probably the most useful and well-built IDE add-ons I have ever used. The templates are extremely useful, especially when you can modify them and create your own. Here are a few templates that I have created for Pex and Moles.

NOTE: These templates are for the Microsoft Test Framework, and will not work when in an NUnit project.  The template shortcut is highlighted in yellow, followed by a description and an example of its output.
  • ummf    Using MS Moles Framework
     using Microsoft.Moles.Framework;
  • [ma    Moled Assembly Attribute

  • [mt    Moled Type Attribute

  • tm    Test Method
    I really liked the way the Unit Testing with Microsoft Moles document lays out test methods. I modified the existing test method (tm) template, to the following:

  • tmm    Test Moles Method

  • mp    Pex Method

  • [hm    Moles Host Type Attribute

  • [pm    PexMethod Attribute

No comments:

Post a Comment

Please provide details, when posting technical comments. If you find an error in sample code or have found bad information/misinformation in a post, please e-mail me details, so I can make corrections as quickly as possible.