NUnit 示例代码?
我想学习如何使用 NUnit。 我通过阅读然后使用真实代码来学习最好的方法。 在哪里可以找到以示例方式使用 NUnit 的小型、简单的 C# 项目?
I would like to learn how to use NUnit. I learn best by reading then playing with real code. Where can I find a small, simple C# project that uses NUnit in an exemplary manner?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(6)
来自我自己的项目(现实生活,所以不仅仅是演示,一切都会变得美好而简单:)
两者都相当小,尽管 MiscUtil 是两者中较大的一个,它主要是非常小的、单独的组件的集合。
MoreLINQ 经过严格测试; MiscUtil 的覆盖范围比较分散,因为我在进行单元测试之前就开始使用它。
From my own projects (real life, so not just demos where everything will be nice and simple :)
Both are reasonably small, and although MiscUtil is the bigger of the two, it's mostly a collection of very small, individual components.
MoreLINQ is heavily tested; MiscUtil has patchier coverage as I started it before getting into unit testing.
您应该在下载 NUnit 时找到 NUnit 示例; 这些是如何使用 NUnit 的非常好的示例。
You should find NUnit samples in with the download of NUnit; these are very good examples of how to use NUnit.
我认为阅读单元测试不如看到有人编写单元测试并解释他们为什么这样做更有帮助。
尝试一些截屏视频。 例如 DimeCast.Net....
I don't think reading unit tests helps as much as seeing someone writing them and explaining why they are doing the way they are.
try some screencasts. DimeCast.Net for example....
这应该很有用...
取自这里 - https://coderwall.com/p/vwvura
This should be useful...
Taken from here - https://coderwall.com/p/vwvura
我建议在 dnrTV 上观看 TDD 视频。 请参阅第 1 部分 和 第 2 部分。
I would recommend to watch video on TDD at dnrTV. See Part 1 and Part 2.
NUnit 的开发人员 wiki 上有很多很好的示例。
由于原始链接已损坏而更新:
基本示例可以在 NUnit 文档页面。 查看入门/快速入门小节和断言/* 小节。
There are many fine examples on NUnit's developer wiki.
Update as the original link is broken:
Basic examples can be found on the NUnit Documentation Page. Check out the Getting Started/QuickStart subsection, and the Assertions/* subsection.