Created
May 6, 2018 18:42
-
-
Save angelovstanton/c2b1b28d8336bebd72e320092cd9738a to your computer and use it in GitHub Desktop.
This file contains 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
[DataTestMethod] | |
[DynamicData(nameof(GetData), DynamicDataSourceType.Method)] | |
public void TestAddDynamicDataMethod(int a, int b, int expected) | |
{ | |
var actual = _calculator.Add(a, b); | |
Assert.AreEqual(expected, actual); | |
} | |
public static IEnumerable<object[]> GetData() | |
{ | |
yield return new object[] { 1, 1, 2 }; | |
yield return new object[] { 12, 30, 42 }; | |
yield return new object[] { 14, 1, 15 }; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment