Last active
August 29, 2015 13:57
-
-
Save chandu/9807661 to your computer and use it in GitHub Desktop.
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
| [Subject("Calculator ")] | |
| internal class DummySpec | |
| { | |
| class Calculator | |
| { | |
| public int add(int a, int b) | |
| { | |
| return a+b; | |
| } | |
| } | |
| static Calculator _calculator; | |
| static int _result = 0; | |
| Establish context = () => | |
| { | |
| _calculator = new Calculator(); | |
| }; | |
| Because of = () => | |
| _result = _calculator.add(1, 2); | |
| public class when_adding_negative_numbers | |
| { | |
| // adding a "because" here just to simulate an error scenario. | |
| Because of = () => | |
| _result = _calculator.add(1, -2); | |
| It should_add_them = () => | |
| _result.ShouldEqual(2); | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment