[TestCase(new[] { 1, 2 }, 1, Result = 2)]
[TestCase(new[] { 1, 2 }, 2, Result = 1)]
[TestCase(new[] { 1, 2, 3 }, 2, Result = 2)]
[TestCase(new[] { 1, 2, 3, 4 }, 2, Result = 2)]
[TestCase(new[] { 1, 2, 3, 4 }, 10, Result = 1)]
public int TotalPageCountIsAccurate(int[] testSequence, int pageSize)
{
var pagedList = new PagedList<int>(testSequence, 0, pageSize);
return pagedList.TotalPageCount;
}
I wrote this test about five minutes ago and I can barely understand it - I dread to think how hard it will be to read in a few weeks. How can I refactor the TestCase
attribute to improve readability?
I thought about using named arguments or (maybe) introducing a some well-named fields, but neither of these ideas appear to be feasible.
TestCase
attribute's argument names are along the lines ofArgument1
,Argument2
etc. which is no more descriptive than not using named arguments. – ByteBlast Jul 4 '14 at 6:57