Resharper ‘test’ Template

When writing automated tests I get tired of typing this over and over again:

public void when_foo_happens_then_bar() {



So I made a ReSharper Live Template:

	public void $NAME$() {



Now getting test definitions into the test class goes more like this:

“hmm, what should I test?  How about,

testwhen_i_then_j …”

With this template I found that not only do I saving typing time, but its also helped me brainstorm a bunch of tests quickly without distracting myself with the format.

You can type it yourself, or download it from github and import.

To Import:  Resharper -> Tools -> Template Explorer -> Live Templates Tab -> Import button

UPDATE 6/6/2015:  I have updated the template so that there is one for NUnit and another for the .NET Test Framework.  Get the import file here:

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s