How to apply unit tests in ASP.NET web forms

I am developing a website in asp.net web forms with 3 layers; UI, BLL and DAL A website has already been developed, but I like to control the unit tests of each form more.

Pass specific values ​​on specific inputs to see if the application survives or not.

I am already learning NUnit, but in web forms at the user interface level, how can I apply these tests?

That I wnat gets some way to check the UI (checks) without having access to the BLL, since I was a user.

I am trying to add unit tests to my application, but I'm not sure how to do it!

can anyone help my problem with small size?

+4
source share
2 answers

If I understand your question correctly, you are asking how to automate testing of the WebForms interface. If I misunderstand, please correct this understanding.

Honestly, I do not think there is a good answer for this. However, there are two options:

0
source

You can add unit test to your user interface using one of these tools.

With both tools, you can create C # or VB classes that can be used by NUnit. IMHO, the UI test is not as reliable as regular tests. Depending on the conditions of synchronization, you may accidentally discover that some test fails.

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

Here is an example of using Watin with NUnit http://www.codeproject.com/KB/applications/SimpleUITestHarness.aspx

And here is a guide on 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

+3
source

Source: https://habr.com/ru/post/1305679/


All Articles