Remove unnecessary type constraints on test helpers

The T:class type constraint is not required, and prevents using value types like KeyValuePair.