Introducing developwithpassion.specifications

developwithpassion.specifications is a formalization of a testing library that I have been using for the last 1.5 years. It is written as a thin library on top of the following 2 fantastic libraries:

With the help of Machine.Fakes it currently can be used to do interaction based testing with the following faking libraries:

Thanks to the Machine teams and Bjorn Rochel for the contributions that this library heavily leverages.

Contributing code

Getting Started

Building from source

  • Make sure you have the .Net Framework 4.0 installed on your machine.

Clone the repository from github and run the following command at a command prompt:

  • build.cmd dist:zip

If the build does not work, please submit an issue through a pull request. After a succesful build you will find all of the zip files under the distribution/zips folder. Currently only 5 of the zip files created are important:

  • – Contains the core library
  • – Contains the adapters for Machine.Fakes.RhinoMocks
  • – Contains the adapters for Machine.Fakes.FakeItEasy
  • – Contains the adapters for Machine.Fakes.NSubstitute
  • – Contains the adapters for Machine.Fakes.Moq

Getting developwithpassion.specifications via NuGet

Installing with NuGet is a snap. There are currently 4 packages available on NuGet (one for each of the Machine.Fakes adapter libraries). To use with Rhino.Mocks for example, just launch the package manager console and type:

  • install-package developwithpassion.specifications.rhinomocks

This will install all of the necessary dependencies for the library. The other packages that you could choose are:

  • developwithpassion.specifications.fakeiteasy
  • developwithpassion.specifications.moq
  • developwithpassion.specifications.nsubstitute

How to use it

The core of the functionality in developwithpassion.specifications can be accessed by deriving your test classes from one of the following 3 classes:

  • Observes
  • Observes< ClassToTest >
  • Observes< Contract , Class >

The last 2 classes provide access to automatic creation of the system under test.

The developwithpassion.specifications.examples project contains many examples of how to use different features of the library. Feel free to contribute other examples as you see fit.

Develop With Passion®