Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

SpecsFor is a light-weight Behavior-Driven Development framework that focuses on ease of use for *developers* by minimizing testing friction.

branch: master
Octocat-spinner-32 .nuget update to VS2013 November 28, 2013
Octocat-spinner-32 Deploy Minor tweak to the packaging script. January 04, 2014
Octocat-spinner-32 SpecsFor.Demo Upgraded NuGet packages. January 03, 2014
Octocat-spinner-32 SpecsFor.Mvc.Demo.AcceptanceTests Updated binding redirects for MVC 5.1, added missing Moq reference to… March 02, 2014
Octocat-spinner-32 SpecsFor.Mvc.Demo Downgraded SpecsFor.Mvc.Demo to .NET 4.0 and MVC 4 to demonstrate bac… January 03, 2014
Octocat-spinner-32 SpecsFor.Mvc.Specs update to MVC 5.1 February 13, 2014
Octocat-spinner-32 SpecsFor.Mvc Bumped version number, this commit corresponds to 3.1.0 release on Nu… March 02, 2014
Octocat-spinner-32 SpecsFor.Tests Cleaned up some uses of Object that should have been typed to ISpecs … January 07, 2014
Octocat-spinner-32 SpecsFor Cleaned up some uses of Object that should have been typed to ISpecs … January 07, 2014
Octocat-spinner-32 WebDrivers Added the latest versions of Chrome and IE drivers. January 04, 2014
Octocat-spinner-32 packages remove packages November 28, 2013
Octocat-spinner-32 .gitignore remove packages November 28, 2013
Octocat-spinner-32 LICENSE.md SpecsFor is now covered by the MIT license. May 21, 2013
Octocat-spinner-32 README.md Fixed a few formatting things in the readme file. June 18, 2011
Octocat-spinner-32 SpecsFor.5.1.ReSharper Reorganized after importing from SVN June 06, 2011
Octocat-spinner-32 SpecsFor.6.0.ReSharper Added SpecsFor templates to Resharper. December 14, 2011
Octocat-spinner-32 SpecsFor.6.1.ReSharper -Added support for parameterized contexts. January 02, 2012
Octocat-spinner-32 SpecsFor.ncrunchsolution Complete rewrite of SpecsFor's base class. February 25, 2013
Octocat-spinner-32 SpecsFor.sln update to VS2013 November 28, 2013
Octocat-spinner-32 todo.txt Updated todo notes. November 15, 2011
README.md

Project Description

SpecsFor is another Behavior-Driven Development framework that focuses on ease of use for developers by minimizing testing friction.

Main Features

SpecsFor is a Behavior-Driven Development style framework that puts developer productivity ahead of all other goals. The current release features:

  • AutoMocking - Easily configure and verify behavior.
  • ReSharper Live Templates - Quickly create specs with only a few keystrokes.
  • Clean Separation of Test State - Encapsulate test setup and reuse it across as many specs as you like. Run The Same Specs Multiple Times With Different Contexts - SpecsFor allows you to assert the same things are true given any number of contexts.
  • Mix And Match Contexts - Context can be combined and extended to support complex test setup without code duplication or excess noise in your specs.
  • Declarative Context - Context can be established in many ways, including by simply marking your spec class with a special attribute.
  • Works With Any NUnit Test Runner - No add-ins are needed, SpecsFor is fully compatible with all popular test runners including TestDriven.NET, Resharper, and TeamCity.

Examples

[Given(typeof(TheCarIsNotRunning), typeof(TheCarIsParked))]
[Given(typeof(TheCarIsNotRunning))]
public class when_the_key_is_turned : SpecsFor<Car>
{
    public when_the_key_is_turned(Type[] context) : base(context){}

    protected override void When()
    {
        SUT.TurnKey();
    }

    [Test]
    public void then_it_starts_the_engine()
    {
        GetMockFor<IEngine>()
            .Verify(e => e.Start());
    }
}
public class when_the_key_is_turned_alternate_style : SpecsFor<Car>
{
    protected override void Given()
    {
        Given<TheCarIsNotRunning>();
        Given<TheCarIsParked>();

        base.Given();
    }

    protected override void When()
    {
        SUT.TurnKey();
    }

    [Test]
    public void then_it_starts_the_engine()
    {
        GetMockFor<IEngine>()
            .Verify(e => e.Start());
    }
}

SpecsFor In Action

Check out the current version in action: http://www.youtube.com/watch?v=MVwguBsR6eA

See an earlier prototype of SpecsFor in action: http://www.youtube.com/view_play_list?p=982492E9FAE3F64A

Read more about SpecsFor at http://trycatchfail.com/blog

Something went wrong with that request. Please try again.