Unit testing C# protected methods

后端 未结 6 1225
再見小時候
再見小時候 2020-12-23 15:39

I come from the Java EE world but now I\'m working on a .Net project. In Java when I wanted to test a protected method it was quite easy, just having the test class with the

6条回答
  •  鱼传尺愫
    2020-12-23 16:46

    You can use reflection to invoke private and protected methods.

    See here for more:

    http://msdn.microsoft.com/en-us/library/66btctbe.aspx

提交回复
热议问题