[DataRow]
noun
say it: “DAY-tuh-roh” /ˈdeɪtəroʊ/
An MSTest attribute that gives a test method one set of arguments, so it runs once per row.
What does [DataRow] do in MSTest?
[DataRow] — An MSTest attribute that gives a test method one set of arguments. Stack several and the same test runs once per row, each reported on its own, instead of one copied test per value.
[TestMethod]
[DataRow(100, 10)]
[DataRow(40, 0)]
public void Discount_ByTotal(int total, int expected) =>
Assert.AreEqual(expected, Pricing.Discount(total));
In a sentence
- “Three DataRow attributes run the discount test for $40, $100 and $250.”
Level: Apprentice · More Unit Testing terms at this level
Updated