Skip to content

Instantly share code, notes, and snippets.

@prabirshrestha
Created October 28, 2012 18:57
Show Gist options
  • Save prabirshrestha/3969466 to your computer and use it in GitHub Desktop.
Save prabirshrestha/3969466 to your computer and use it in GitHub Desktop.
[Fact]
public void AdditionTest() {
// given
int a = 1;
int b = 2;
// when
var result = Math.Add(a, b);
// then
Assert.Equal(3, result);
}
[Theory]
[InlineData(0, 0)]
[InlineData(0, 1)]
[InlineData(1, 0)]
[InlineData(10, 20)]
public void Result_should_be_0_when_multiplied_by_0(int a, int b) {
// given (from parameters)
// when
var result = Math.Multiply(a, b);
// then
Assert.Equal(0, result);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment