MSTest Equivalent for NUnit’s Parameterized Tests?

For those using MSTest2, DataRow + DataTestMethod are available to do exactly this: [DataRow(Enum.Item1, “Name1”, 123)] [DataRow(Enum.Item2, “Name2”, 123)] [DataRow(Enum.Item3, “Name3”, 456)] [DataTestMethod] public void FooTest(EnumType item, string name, string number) { var response = ExecuteYourCode(item, name, number); Assert.AreEqual(item, response.item); } More about it here

How do you generate dynamic (parameterized) unit tests in Python?

This is called “parametrization”. There are several tools that support this approach. E.g.: pytest’s decorator parameterized The resulting code looks like this: from parameterized import parameterized class TestSequence(unittest.TestCase): @parameterized.expand([ [“foo”, “a”, “a”,], [“bar”, “a”, “b”], [“lee”, “b”, “b”], ]) def test_sequence(self, name, a, b): self.assertEqual(a,b) Which will generate the tests: test_sequence_0_foo (__main__.TestSequence) … ok test_sequence_1_bar … Read more