Solved

How do I use Visual Studio's Unit Testing on a Web Site

Posted on 2011-03-01
1
312 Views
Last Modified: 2012-06-22
Hello,

I have a growing web site (not a web application project) that I'm developing in VS2010. I have tried to right click on a class and create unit test and it seems to create a seperate project for testing as it should. However when I try to build the testing poject I get errors like...

The "BuildShadoTask" task failed unexpectedly.
System.WEb.HttpCompileException (0x80004005): C:\[my path]\PurchasedBonds.ascx(12): error CS1502: The best overloaded method match for 'controls_PurchasedBonds.getNameOnBond(Application)' has some invalid arguments.

If I comment out this method I get other similar errors.

What seems funny to me is that I can build and run the actual web site just fine with no errors and no unexpected bugs.

Thanks,
gtar
0
Comment
Question by:gtar
1 Comment
 
LVL 9

Accepted Solution

by:
gdupadhyay earned 500 total points
Comment Utility
If you need to create Unit Test for class library: First You need to create a new test project.

- Add reference of all class or class library.
- Create object of the class in test project.
- Call the methods by assign parameter values.
- Verify the result return by the method

Let me know for question.
0

Featured Post

6 Surprising Benefits of Threat Intelligence

All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

Join & Write a Comment

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…
This article is for Object-Oriented Programming (OOP) beginners. An Interface contains declarations of events, indexers, methods and/or properties. Any class which implements the Interface should provide the concrete implementation for each Inter…
The viewer will learn how to synchronize PHP projects with a remote server in NetBeans IDE 8.0 for Windows.
The viewer will learn how to use and create new code templates in NetBeans IDE 8.0 for Windows.

762 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

9 Experts available now in Live!

Get 1:1 Help Now