I’m trying to unit test a class with 2 constructors. Each constructor has multiple parameters that set public properties. My question is, should I have only 2 unit tests with multiple asserts to check that each property was set OR a test for each parameter for each constructor?
Public Person(string name, string phone, string birthday) { name = name; phone = phone; birthday = birthday; } Public Person(string name) : this(name, null, null) {}
The operation that you are testing is that the constructor accepts __ parameters and that the values are set to the proper value.
Therefore I would say 1 test per constructor, with multiple asserts on each, to ensure that all members are properly set.