任何具有良好单元测试的 ASP.NET (WebForm) 应用程序(CodePlex 或任何地方)?
我正在寻找任何在其解决方案中具有一些良好单元测试的 ASP.NET(WebForms 和 C#)应用程序。测试不同类型的边缘情况并实现良好的代码覆盖率具有良好的意义。 CodePlex、GitHub 或任何地方的任何应用程序都可以。
这是出于教育目的,因此我更喜欢较小的应用程序而不是大型应用程序。 有什么建议吗?
说明:
虽然应用程序是 WebForms,但我感兴趣的单元测试更多的是业务逻辑,而不是 UI。是的,任何 .NET 应用程序都可以做到,但如果它是带有一些 UI 测试的 WebForms,那就更好了。
I am looking for any ASP.NET (WebForms & C#) app which has some good unit tests in its solution. Good meaning testing different kinds of edge cases and does a good code coverage. Any app on CodePlex, GitHub or anywhere is fine.
This is for educational purposes so I prefer smaller apps than large ones.
Any recommendations?
Clarification:
While the app is WebForms, the unit tests I am interested is more on business logic, not the UI. Yes any .NET app can do but if it is WebForms with some UI testing, the better.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(5)
ScrewTurn wiki 是开源的,版本 3.x 采用 C# 和 ASP.NET 3.5 编码,并且源代码与组件的测试捆绑在一起。
ScrewTurn wiki is open-source, version 3.x is coded in C# and ASP.NET 3.5, and the source comes bundled with tests for the components.
我个人认为,业务逻辑层的单元测试对于任何 Web 应用程序来说都是不够的,无论使用什么框架。
最好的策略是进行严格的“冒烟测试”,可能保存在 Excel 工作簿中,在其中执行每组已知的可能的输入和操作,并能够确定每当进行新部署时“一切正常”。
单元测试很有价值,但它们无法重现生产中应用程序的行为。
I personally believe that unit tests in the business logic layer are not sufficient for any web application, no matter what the framework used.
The best policy is to have a serious "smoke test", perhaps kept in an Excel workbook, where you exercise every known possible set of inputs and actions and are able to determine that "everything works" whenever you do a new deployment.
Unit tests are valuable, but they cannot reproduce the behavior of an application in production.
看看这个。不确切知道这是否是您想要的:)它是实现了 MVP 模式的 ASP.NET,并且有一些测试覆盖率 - .NET Framework 3.5 捆绑包
Take a look at this. Don't know exactly if it's what you wanted :) It is ASP.NET with MVP pattern implemented and it has some test coverage - .NET Framework 3.5 Bundle
我刚刚完成了一个电子商务网站。
对于业务逻辑,我创建了一个单独的 dll,并使用 NUnit 来测试它。 Nunit 使用简单,使用 .bat 文件启动简单(且快速),并且可以使用图形界面。
在网站中,我使用 NLOG 来记录用户操作。在这种情况下,最好的方法(在您测试一段时间之后)是将您的站点提供给某个最终客户,并在每次出现异常时查看日志文件。
I've just finish a web e-commerce site.
For the business logic I create a separate dll, and I use NUnit to test it. Nunit is simple to use, it's simple (and fast) to launch with a .bat file and it is possible to use a graphic interface.
In the web site, I use NLOG for logging user action. In this case the best way (after YOU test it for a while) is to give your site to some final customer, and watch the log file every time there is an exception.
我知道您正在寻找编码示例来学习单元测试,但是
Karl Seguin 的《编程基础 - 构建更好的软件》
是一本好书,可以帮助指导您完成单元测试和模拟的过程。它只有 79 页长,应该可以让您快速上手并运行。
http://openmymind.net/FoundationsOfProgramming.pdf
I know you are looking for coding examples to learn unit testing but
Foundations of Programming - Building Better Software By Karl Seguin
is a good book to help guide you through the process of unit testing a mocking. It's only 79 pages long and should get you up and running quickly.
http://openmymind.net/FoundationsOfProgramming.pdf