mardi 7 avril 2015

How to specify datasource in data-driven unit test? C#

I have written a data-driven unit test and now I need to specify the data source for the unit test. The unit test is written in C# with MS Visual Studio. My data source is an excel file with a sheet named "TestData". My code for data source is as follows:



[DataSource(
"System.Data.Odbc",
"Dsn=Excel Files;dbq=.\data.xlsx;defaultdir=.; driverid=790;maxbuffersize=2048;pagetimeout=5",
"TestData$",
"Sequential"
)]


What's wrong and how to fix it?


Aucun commentaire:

Enregistrer un commentaire