How to unit test constructors

后端 未结 7 685
执念已碎
执念已碎 2020-12-08 10:14

I have a class I am adding unit tests to. The class has several constructors which take different types and converts them into a canonical form, which can then be converted

相关标签:
7条回答
  • 2020-12-08 10:42

    Constructor is an object initializer. Constructor testing is a test of the fact of initialization. That is, verification that the object's fields were initialized by the values passed to the constructor. And this can only be verified by reflection.

    0 讨论(0)
提交回复
热议问题