views:

68

answers:

2

Hi guys.

I'm developing a website in asp.net webforms with 3 layers; UI, BLL and DAL The website is already developed, but i like have more control about the unit tests of each form

Pass specific values at specific inputs for i see, if application survives or not.

I already study about NUnit but in webforms in UI layer how can apply these tests?

What i wnat is get some way to test UI (validations) without have to access to the BLL as i was an user.

I'm trying to add the Unit tests to my app but i not sure how to do it!

somebody can help my small-bigger problem?

apreciated

A: 

If I understand your question correctly, you're asking how to automate testing a WebForms UI. If I misunderstand, please correct this understanding.

Frankly, I don't think there is a good answer out there for this. There are two options, however, that work okay:

  1. Visual Studio Test Edition
  2. Telerik's Web Testing (both a free version and a version with a cost)
Jaxidian
+1  A: 

You can add unit test to your UI using one of these tools

With both tools you can generate C# or VB classes that can be used by NUnit. IMHO, UI test are not as reliable as the common unit tests. Bacause timing conditions randomly you may find that some test fails.

I used both tools and I recommend selenium mainly because you can generate test that can be run against any browser.

Here an example how to use Watin with NUnit http://www.codeproject.com/KB/applications/SimpleUITestHarness.aspx

And here a guide how to use Seleniun with Nunit http://www.lostechies.com/blogs/agilecruz/archive/2009/02/10/how-to-configure-selenium-rc-for-use-in-c-nunit-tests.aspx

Claudio Redi