Skip to content

Instantly share code, notes, and snippets.

@chandu
Last active August 29, 2015 13:57
Show Gist options
  • Save chandu/9807661 to your computer and use it in GitHub Desktop.
Save chandu/9807661 to your computer and use it in GitHub Desktop.
[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