Last active
December 25, 2015 08:28
-
-
Save copypastedeveloper/6946462 to your computer and use it in GitHub Desktop.
given nunit example
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| [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