Solved

NUnit asp.net Application

Posted on 2013-11-01
2
323 Views
Last Modified: 2013-11-08
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
Comment
Question by:jssong2000
2 Comments
 
LVL 35

Accepted Solution

by:
Miguel Oz earned 500 total points
ID: 39617986
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
 

Author Closing Comment

by:jssong2000
ID: 39634385
Thank you!
0

Featured Post

DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction This article shows how to use the open source plupload control to upload multiple images. The images are resized on the client side before uploading and the upload is done in chunks. Background I had to provide a way for user…
Problem Hi all,    While many today have fast Internet connection, there are many still who do not, or are connecting through devices with a slower connect, so light web pages and fast load times are still popular.    If your ASP.NET page …
This is used to tweak the memory usage for your computer, it is used for servers more so than workstations but just be careful editing registry settings as it may cause irreversible results. I hold no responsibility for anything you do to the regist…
This video shows how to quickly and easily add an email signature for all users on Exchange 2016. The resulting signature is applied on a server level by Exchange Online. The email signature template has been downloaded from: www.mail-signatures…

815 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

7 Experts available now in Live!

Get 1:1 Help Now