Last active
May 9, 2024 16:31
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
public class CalculatorTests | |
{ | |
[Theory] | |
[MemberData(nameof(TestData))] | |
public void CanAdd(int value1, int value2, int expected) | |
{ | |
var calculator = new Calculator(); | |
var result = calculator.Add(value1, value2); | |
Assert.Equal(expected, result); | |
} | |
public static IEnumerable<object[]> TestData => | |
new List<object[]> | |
{ | |
new object[] { 1, 2, 3 }, | |
new object[] { -1, -2, -3 } | |
}; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment