Consider the following test:
[TestCase(2016, true)]
[TestCase(2017, false)]
[TestCase(2018, false)]
[TestCase(2019, false)]
[TestCase(2020, true)]
public void When_IsLeapYear_ReturnTrueForLeapYear(int year, bool expectedResult)
{
var result = _sut.IsLeapYear(year);
Assert.AreEqual(result, expectedResult);
}
Is it wrong to use both the year and the expected results in such test scenarios, instead of creating two different tests (for example, one to expect true, one to expect false?)
thanks
source
share