Git Product home page Git Product logo

specsfor's Introduction

#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

specsfor's People

Contributors

matthoneycutt avatar kradcliffe avatar

Watchers

John Cashman avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.