I have a unit test like this:
[Test] public void DataIn_NoOfRowsReached_CreatesSequentialData() { //Assert MyLogic logic = SetupLogic(); logic.NoOfRows = 3; logic.DataIn(1, "1,4,7"); logic.DataIn(2, "2,5,8"); logic.DataIn(3, "3,6,9"); CollectionAssert.AreEqual(new[] { "1", "2", "3", "4", "5", "6", "7", "8", "9" }, logic.ExpectedValues); }
Each call to DataIn adds the transferred data to a separate list depending on the identifier (1st parameter). When the NoOfRows number is equal to the input DataIn identifier, it combines the data that should be sequential. Then I check it out.
Now I want to use test cases, but I see no easy way to do this without using operators and various optional parameters in the test method. I really don't want to duplicate tests for different scenarios.
The maximum of NoOfRows is 6.
source share