Community Callout – FakeItEasy CodeRush Templates

CodeRush User Richard O'Neil has created his own set of FakeItEasy templates to speed his development.

These templates give him an edge when creating his fake objects using this popular framework.

In case you’re unaware, FakeItEasy is a Mocking framework for .Net which is hosted on GitHub

Templates

As I write this, Richard has support for the following templates:

Setup FakeItEasy

Trigger: ufie<space>
Effect: Adds ‘FakeItEasy’ to the namespace references of the current file.

FakeItEasyNamespaceReference

Note:This template does not need to be called explicitly since it is called for each of the following templates already. Additionally, the reference is added in the correct location above the class definition.

Create a Fake Object

Trigger: fief<space>
Expands to:

FakeItEasyFakeObject

Set up a call to return a value

Trigger: fiecr<space>
Expands to:
FakeItEasyCallReturn

Creating ignore parameters

Template: fieany?Type?

Examples:

fieanyi<space>
Expands to:
FakeItEasyIgnoreInt


fieanys<space>
Expands to:
FakeItEasyIgnoreString

Being the awesome community person he is, Richard has published these templates on github so anyone can take advantage of them.

If you’d like to use these templates in your own projects, download the xml file from the repository and follow the Import instructions in this post

Update: If you’re using the Template Importer plugin, you can pass it this url to import the FakeItEasy templates straight off the web.

no comments
No Comments

Please login or register to post comments.