Programming

xUnit Theories with Type Parameters

When unit testing generic protocols like the Lego Wireless Protocol input values might be lead to different expected values. Sometimes, however, not only the value changes but also the data types of what to expect. xUnit's Assert.Equal(expected, actual) methods has overloads for countless basic data types like short, double, bool and elementary support for enums. To activate these, the expected argument would need to be parameterized with the right data type.