如何使用nunit测试私有方法 [英] How to test private methods using nunit

查看:102
本文介绍了如何使用nunit测试私有方法的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何使用nunit测试私有方法有没有办法或者我们只能使用nunit测试公共方法?

How to test private methods using nunit is there any way or can we test only public methods using nunit ?

推荐答案

参考文件

http://stackoverflow.com/questions/249847/how-do -you-test-private-methods-with-nunit [ ^ ]

http://stackoverflow.com/questions/16833658/how-to-write-unit-tests-around-private-methods [ ^ ]

如何测试私有和受保护的方法在.NET [ ^ ]
Ref.
http://stackoverflow.com/questions/249847/how-do-you-test-private-methods-with-nunit[^]
http://stackoverflow.com/questions/16833658/how-to-write-unit-tests-around-private-methods[^]
How to Test Private and Protected methods in .NET[^]





我不认为使用nunit测试私有方法是可能的。此外,我认为没有必要在TDD中包含私人方法。



您可以参考网址更好的解释:



http://www.peterprovost .org / blog / 2012/05/31 / my-take-on-unit-testing-private-methods [ ^ ]









问候

Dominic
Hi
I don't think testing private methods using nunit is possible. Also i think there is no need to include private methods in TDD.

You can refer the url with better explanation:

http://www.peterprovost.org/blog/2012/05/31/my-take-on-unit-testing-private-methods[^]




Regards
Dominic


这篇关于如何使用nunit测试私有方法的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆