I want to do several tests with a list of different inputs which are complex objects. Using NUnit, I do the following:
private static readonly IEnumerable<object> InputList = new List<object>
{
new { aaa = 1, bbb = 2}, // Simplified example
new { aaa = 1, bbb = 2},
new { aaa = 1, bbb = 2},
};
[Test, TestCaseSource("InputList")]
public void Test(object testElement)
{
// Whatever
}
However, that way I get a warning: IDE0052: Private memeber InputList can be removed as the value assigned to it is never read, which is clear because of the fact that TestCaseSource uses InputList as a string, not as an actual reference.
Do I have to suppress the warning or I am doing something wrong?