Ashu283

Hi,

I need to know is it is possible to use DataSet or Sql query to do data driven unit testing

As I have a table with large number of data and I want to access only few of it.

Or is it possible to stop testcontext.datarow after it has ran for some specific number of rows



Re: Visual Studio Team System - Testing Can we use DataSet or Sql query for data driven testing


Re: Visual Studio Team System - Testing Can we use DataSet or Sql query for data driven testing

Ashu283

No, I have started my work on Data Driven Tests from there only.

Problem with my work is that we can't afford to add new physical tables in our database and existing table from which we need data for data driven testing has millions of rows and we don't want to run test for all these millions of rows.

Now if you can give some suggestions for 'how to drive a data driven test for some limited number of rows of a table '.





Re: Visual Studio Team System - Testing Can we use DataSet or Sql query for data driven testing

Rituparna MSFT

Hi

You can create a DB Query with proper Clause to filter out the rows required from the table and then loop through the

query results and run your tests. The disadvantage is that you will not be able to get info on the results obtained in each iteration and your

results will be overwritten by results of next iteration.

One workaround is to print out the result obtained in each iteration and then read that out to get the final results.

Hope this helps

Rituparna





Re: Visual Studio Team System - Testing Can we use DataSet or Sql query for data driven testing

Michael Koltachev - MSFT

The name of the data table you specify for a data driven unit test can be a view name or "select" stored procedure name. Create a data view in your database, by filtering some data from your table. Then select your data driven test in Test View, do right click->Properties, expand the "Data Table Name" property drop down and select your view name.

Thanks,
Michael





Re: Visual Studio Team System - Testing Can we use DataSet or Sql query for data driven testing

Ashu283

Thanks for replies.

They are really helpful.

My problem is solved by Michael's suggestion. Now i can have data of my choice only.

@Ritu: I tried same thing, and faced same prob as stated by you. As it was very nesty to read from console all the results. As I have lots of tests to run.

But thanks again.

Cheers,

Ashutosh N Goyal