• Stars
    star
    197
  • Rank 196,812 (Top 4 %)
  • Language
    C#
  • License
    MIT License
  • Created over 13 years ago
  • Updated over 1 year ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

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

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 docs at http://specsfor.readme.io

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

More Repositories

1

Fail-Tracker

Fail Tracker is an agile issue tracking system written with ASP.NET MVC.
CSS
136
star
2

HeroicFramework

The Heroic Framework contains utilities and application framework infrastructure to streamline .NET application development.
C#
67
star
3

asp.net-samples

A collection of ASP.NET samples.
C#
13
star
4

HeroicSamples.BootstrapAlerts

Illustrates a method of displaying Bootstrap Alert messages in ASP.NET Core applications.
C#
12
star
5

ps-create-iot-solutions

Sample code for my "Create IoT Solutions" course at Pluralsight.
C#
10
star
6

MvcDisplayTemplates

ASP.NET MVC Razor templates that mimic the behavior of the embedded MVC 3 DisplayTemplates that ship with System.Web.Mvc.
PowerShell
10
star
7

codestock2015

Code and slides from my CodeStock 2015 talks!
JavaScript
9
star
8

heroic-gulp

A starting point/proof of concept of a streamlined, reusable gulp v4 setup. The goal is for this to be usable across web, Cordova, etc.
JavaScript
7
star
9

BlackMagicMVC

A sample application that shows how to consume a C# MVC project with Razor views from a VB.NET WebForms application.
JavaScript
6
star
10

HeroicSupport

Toy support ticketing system for my presentations at CodeStock 2013.
JavaScript
5
star
11

NashDotNet-Nov2015

Code and slides for my Nashville .NET User Group Talk - November 2015
CSS
4
star
12

Presentations

Code and slides from my various presentations.
JavaScript
4
star
13

HeroicSamples.AspNetCoreWithNgNotifications

Sample app illustrating ng-notifications with Angular 5 and ASP.NET Core 2.1.
TypeScript
3
star
14

perfectpdf-sample

Sample code for Perfect PDF, the HTML to PDF converter for ASP.NET MVC.
C#
3
star
15

HeroicCRM

A sample ASP.NET MVC application that shows how you can write strongly-typed AngularJS applications.
JavaScript
3
star
16

intro-to-angular-for-aspnet-devs

Sample code and slides for my presentation on AngularJS.
C#
2
star
17

generate-address

A node CLI app to generate random (real) US street addresses.
JavaScript
2
star
18

AddingAngularBlogPost

Source code for the Pluralsight blog post that shows how to add AngularJS to a new ASP.NET 5 project.
C#
2
star
19

HeroicSamples.PassingDataFromAspNetCoreToAngular

Shows one approach for passing configuration data from ASP.NET Core to Angular 4+.
TypeScript
2
star
20

HeroicSamples.AspNetCore21PreviewWithAngular

Sample app illustrating the new ASP.NET Core 2.1 Angular 5 template.
TypeScript
1
star
21

HeroicSamples.AspNetCoreWithAngularCli

Sample app illustrating ASP.NET Core with an Angular 5 CLI application built in.
TypeScript
1
star
22

heroic-gulp-demo

The heroic-gulp package in action.
HTML
1
star