Skip to content

Instantly share code, notes, and snippets.

@copypastedeveloper
Last active December 25, 2015 08:28
Show Gist options
  • Select an option

  • Save copypastedeveloper/6946462 to your computer and use it in GitHub Desktop.

Select an option

Save copypastedeveloper/6946462 to your computer and use it in GitHub Desktop.
given nunit example
[Story(AsA = "car manufacturer",
IWant = "a factory that makes the right cars",
SoThat = "I can make money")]
public class building_a_toyota : Scenario
{
static CarFactory _factory;
static Car _car;
given a_car_factory = () =>
{
_factory = new CarFactory();
};
when building_a_car = () => _car = _factory.Make(CarType.Toyota);
[then]
public void it_should_create_a_car()
{
_car.ShouldNotBeNull();
}
[then]
public void it_should_be_the_right_type_of_car()
{
_car.Type.ShouldEqual(CarType.Toyota);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment