exceptionz

Thoughts on Technology, Methodology and Programming.

Archive for April 20th, 2007

ReSharper UnitTestSupport Add-in for NSpecify

Posted by Marcus Wyatt on 20 April 2007

t: I’ve never posted the link to the download, you can find it below or here.

Edit: I would suggest you rather grab a copy of the source using Subversion or Git (If you’ve been adventurous) and build the library yourself. The source supports both VS2K5 & VS2K8, so if your version of VS is 2K8, you can take advantage of the new language extension method features. If not, you’ll be able to do the plain old vanilla spec’s.

Here is the svn command:

svn co http://nspecify.svn.sourceforge.net/svnroot/nspecify nspecify

via the command line. If you are using TortoiseSVN just create a directory somewhere and use this

http://nspecify.svn.sourceforge.net/svnroot/nspecify

url in TortoiseSVN to pull down the source.

Once you’ve compiled the assemblies, you just need to copy the following

  • JetBrains.ReSharper.PowerToys.NSpecify.dll
  • JetBrains.ReSharper.PowerToys.NSpecify.xml

assemblies to the this directory:

C:\Program Files\JetBrains\ReSharper\v4.0\v.Everything\Bin\Plugins\NSpecify

If the Plugins and NSpecify directories don’t exist, create them.

————————————————————————

The NSpecify Unit test support plug-in for resharper will give you the ability to run your NSpecify specification with the ReSharper UnitRun 1.0 or ReSharper for Visual Studio 2005.

Next to declarations of test classes and single tests, ReSharper adds special icons on the left gutter of the editor window. Click these icons to run or debug tests. You can also run tests for a whole solution or project from the Visual Studio’s Solution Explorer. Just right-click the project or solution and select run or debug tests.

When you start running unit tests, ReSharper opens the Unit Test Runner window that is intended to help you with analyzing test results. Using this window, you can also run/re-run any tests. With Unit Test Runner , you can navigate from a failed test’s output to the lines that originated the exception, all with a single click.

Here is the Installation instructions:

  1. Close Visual Studio 2005.
  2. Extract the contents of archive, including the NSpecify folder, to: %ProgramFiles%\JetBrains\ReSharper\VS2005\Plugins
  3. Launch Visual Studio 2005.
  4. Open a project containing NSpecify specs.
  5. Open a spec’s file containing a functionality with Specifications. Standard ReSharper icons will appear in the left margin and allow you to run the specifications.

Known Issues – via James Kovacs

  • ReSharper Unit Test Runner icons do not appear beside Functionality Fixture and Specification Methods.
    ——————————————————————————————————-
    This is typically caused by having an assembly reference to another unit test framework. ReSharper Unit Test Runner (and UnitRun) only support a single unit test framework per test assembly. Remove references to other test frameworks from the References in your spec project. This is a known limitation in the JetBrains’ current unit test runner implementation. A plugin votes on whether the current assembly contains tests that it can run. If the plugin votes “yes”, the unit test runner stops querying additional plugins. NUnit and csUnit get queried before third-party plugins.

For additional ReSharper test plug-in:

Posted in BDD, Development, Software, TDD | 9 Comments »