本文介绍了解决方法pex内部类的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当被测类是内部类时,有什么方法可以使pex工作吗?密封类怎么样?

Is there any way to make pex work when the classes under test are internal? how about sealed classes?

我的意思是,毕竟所有这类工具都非常适合API测试,但是您有时可能希望至少保留内部内容.

I mean after all this type of tool is really good for API testing, you are likely to want to keep stuff at least internal sometimes.

谢谢

推荐答案

通过 InternalsVisibleToAttribute .然后,Pex将能够查看"内部类型并进行测试.

Give the test assembly internal visibility through the InternalsVisibleToAttribute. Pex will then be able to 'see' internal types and test them.

这篇关于解决方法pex内部类的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

07-10 23:33