Solved

Unit test cases

Posted on 2015-02-08
7
77 Views
Last Modified: 2015-03-18
Hi Experts,

I see the Web Application on which I am working is merged with both business logic and UI controls in Code behind files. Now I need to write Unit test cases for my application. I just want to confirm can I write test cases for UI controls like Gridview, Dropdownlist population. If not what can be the reason.

Thanks,
meetDinesh
0
Comment
Question by:Dinesh Kumar
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
7 Comments
 
LVL 34

Accepted Solution

by:
ste5an earned 250 total points
ID: 40597872
Yes, you can. But it depends on the code and the used test framework:

VS general UI testing: Verifying Code by Using UI Automation
And Web test require Selenium: Selenium automates browsers.

The problem with tightly coupled code is, that you will have problems in getting a good code coverage.
0
 

Author Comment

by:Dinesh Kumar
ID: 40598014
I am using visual studio Test Explorer existing in Visual studio ultimate edition.
0
 

Author Comment

by:Dinesh Kumar
ID: 40624413
Hi ste5an, thanks for the response, I have come across of testing javascript using QUnit framework and HTML using seleno i.e selenium but my concern is that while calculating code coverage using MSTest, will the test cases written using QUnit and seleno will be counted or MStest will just ignore these test cases :( because mine's ultimate goal is to improve the code coverage in a legacy application.
0
How Do You Stack Up Against Your Peers?

With today’s modern enterprise so dependent on digital infrastructures, the impact of major incidents has increased dramatically. Grab the report now to gain insight into how your organization ranks against your peers and learn best-in-class strategies to resolve incidents.

 
LVL 96

Expert Comment

by:Bob Learned
ID: 40628337
Since you have Visual Studio Ultimate Edition, you should have access to Coded UI tests.

Test Automation Using Visual Studio 2010 Coded UI
https://msdn.microsoft.com/en-us/magazine/hh875174.aspx
0
 

Author Comment

by:Dinesh Kumar
ID: 40631221
Well!   will it help in code coverage using MSTest.. if you can see my last comment in more detail that would help me.
0
 
LVL 96

Assisted Solution

by:Bob Learned
Bob Learned earned 250 total points
ID: 40631357
You can configure the tests to use code coverage.

Customizing Code Coverage Analysis
https://msdn.microsoft.com/en-us/library/jj159530.aspx
0

Featured Post

2017 Webroot Threat Report

MSPs: Get the facts you need to protect your clients.
The 2017 Webroot Threat Report provides a uniquely insightful global view into the analysis and discoveries made by the Webroot® Threat Intelligence Platform to provide insights on key trends and risks as seen by our users.

Question has a verified solution.

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

Cloud-based technologies and services will continue to grow in popularity in 2017 thanks to the simple, scalable and cost-effective solutions they deliver. Here are three areas where cloud adoption is poised to really take off.
The article shows the basic steps of integrating an HTML theme template into an ASP.NET MVC project
Connecting to an Amazon Linux EC2 Instance from Windows Using PuTTY.
Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, just open a new email message. In the To field, type your recipient's fax number @efaxsend.com. You can even send a secure international fax — just include t…

729 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