Any ASP.NET (WebForm) apps which have good unit te

2019-04-30 04:17发布

问题:

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.

回答1:

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.



回答2:

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.



回答3:

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



回答4:

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.



回答5:

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



回答6:

Tony I believe this link should help you http://www.codeproject.com/KB/architecture/nunittestsuite.aspx

Happy Coding !!