Skip to content

Instantly share code, notes, and snippets.

@IEvangelist
Created February 12, 2016 21:03
Show Gist options
  • Save IEvangelist/695e5dae4f5454ba8b72 to your computer and use it in GitHub Desktop.
Save IEvangelist/695e5dae4f5454ba8b72 to your computer and use it in GitHub Desktop.
[Theory, ClassData(typeof(Int32CalculatorTestData))]
public void AddTest(int leftOperand, int rightOperand, int expected)
{
// Arrange
var calculator = new Int32Calculator();
// Act
var actual = calculator.Add(leftOperand, rightOperand);
// Assert
Assert.Equal(expected, actual);
}
public class Int32CalculatorTestData : ClassTestData
{
protected override List<object[]> TestData => new List<object[]>
{
new object[] { 1, 7, 8 },
new object[] { 2, 2, 4 },
new object[] { -33, -77, -110 },
new object[] { 256, -512, -256 },
new object[] { 0, 0, 0 },
};
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment