Skip to content
A lightweight BDD framework for C# using the .NET 4.0 framework - Check the wiki for more examples
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.


specr is a lightweight BDD framework for C#, built on the .NET 4.0 framework.
It is inspired by rspec, and I wrote parts of it to experiment with duck typing, using
some of the .NET 4.0 framework features.

It is designed to be dropped in to your existing unit testing framework. 
It provides a behaviour assertion syntax for C# objects:

var foo = "foo";


Using some conventions, existing unit tests can then be written in a BDD style:

class DescribePerson
	private Creature person;

	public void Before()
		person = new Person();		
		person.IsBig = true;		

	public static void It_Should_Be_Awesome()

This is using the dynamic boolean asserts. 
If you are follow the convention of naming your bool properties in the form "IsSomeValue", specr will 
be able to assert boolean property values using the Be().SomeValue() and NotBe.SomeValue() dynamic methods.

You'll be able to run the unit test above just like any normal unit test. No post build, code generation tools
are needed.

One of specr goals is to target multiple unit test frameworks. It was built using the VisualStudio test framework and 
should also support NUnit (Although I could not get a version of NUnit that could run on my .NET 4 framework version.) 

Since specr is a very lighweight framework, it has just a few specs, all of them written in a BDD style 
using specr itself. 

I'll probably be adding some specs and functionality with time as I use specr.

It's name is also inspired by rspec. As in rspec are first, specr are last. (Lame, I know)
Something went wrong with that request. Please try again.