Affichage des articles dont le libellé est ReSharper. Afficher tous les articles
Affichage des articles dont le libellé est ReSharper. Afficher tous les articles

lundi 25 février 2013

MSTest ReSharper live templates

When developing in Visual studio with MSTest, I like using ReSharper live templates to quickly create my test classes and methods.

To create a test class, I map the following template to "tc":

[TestClass]
public class $TestClass$
{
    $END$
}

To create a test initialize, I map "ti" to:

[TestInitialize]
public void TestInitialize()
{
    $END$
}

And to create a test method, I use "tm" with:

[TestMethod]
public void $TestName$()
{
    $END$
}

mardi 20 septembre 2011

ReSharper test runner with MSTest

The current project I'm working on at my job uses MSTest for testing (and I don't like it!). Anyway, I had an error while running the test suite in Resharper test runner while there were none in Visual Studio test runner.

Actually, the ReSharper test runner create a specific directory where it copies all assemblies under test and runs the test from this location. One of my tests had to load all assemblies in the executing assembly path and some of them were missing. The problem comes from the fact that by default ReSharper is configured to shallow-copy assemblies being tested.

What you need to do is go to Resharper -> Options.

From left side pane select tools -> Unit Test

Uncheck Shallow-copy assemblies being tested

And now, all my tests pass as expected!