Skip to content

Instantly share code, notes, and snippets.

@codingfab
Last active December 3, 2019 17:17
Show Gist options
  • Save codingfab/0083560cc38f53d3236d88afb2fbd115 to your computer and use it in GitHub Desktop.
Save codingfab/0083560cc38f53d3236d88afb2fbd115 to your computer and use it in GitHub Desktop.
Simple TestCase attribute usage
[TestFixture]
public class MyComplexLogicShould
{
[Test]
[TestCase(10,22,32)]
public void ReturnExpectedResult(int a, int b, int expected)
{
// Arrange
var sut = new MyClass();
// Act
var result = sut.MyComplexLogic(a,b);
// Assert
Assert.That(result,Is.EqualTo(expected));
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment