How do I allow assembly (unit testing one) to access internal properties of another assembly?

后端 未结 5 1697
说谎
说谎 2020-12-04 09:51

I would like my Core assembly to not expose a certain class and I would still like to be able to test it. How can I do that ?

5条回答
  •  难免孤独
    2020-12-04 10:19

    You can use reflection (as the MS Test items do), or you can declare the unit test assembly a friend of the core assembly.

    The other option is to put the unit tests in the same assembly.

提交回复
热议问题