Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 349
  • Last Modified:

NUnit asp.net Application

Hi Expert,

I am new in NUnit. It's pretty simple to test a function.
But I really don't know how to setup and test a n-tier asp.net web application.

Any instruction or comment will be very appreciated!!
0
jssong2000
Asked:
jssong2000
1 Solution
 
Miguel OzSoftware EngineerCommented:
This is a summary view: For Nunit, you can only test your business tier if this tier has been properly designed as independent of the other tiers. For example your business logic is in an assembly that you can add to your Nunit project that contain your test methods.
If you have to interact with databases you may need to mock them or you will need a backup/restore sql script to guarantee your initial state is always the same. (if you use the latter it becomes an integration test - the key idea of unit test is to run  in memory without using external dependencies , e.g. interact with DB, web service, file, email)


Some introductory books:
http://pragprog.com/book/utc2/pragmatic-unit-testing-in-c-with-nunit
A bit dated but still relevant and gentle intro to Nunit.
http://artofunittesting.com/
This book is good and the associated web site has nice videos to help you with concepts like mock.
0
 
jssong2000Author Commented:
Thank you!
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Tackle projects and never again get stuck behind a technical roadblock.
Join Now