Mid Testing

How do you write parameterized tests in NUnit?

[TestCase(2, 3, 5)]

[TestCase(10, 20, 30)]

public void Add_ReturnsSum(int a, int b, int expected)

var calculator = new Calculator();

var result = calculator.Add(a, b);

Assert.AreEqual(expected, result);

More from C# Programming Tutorial

All questions for this course