Can someone tutorial me how to create DataSource from Excel File linked wih Unit Test in VS2013? In VS2010 it was possible to open Project -> Test View and then Properties. Now that option is not possible. I tried MSDN help and so on but I cant do that. I would like to reach sh like here http://msdn.microsoft.com/pl-pl/library/testy-jednostkowe-w-visual-studio.aspx between image 16 and 17. Thank you for help
I know how Create new Data source but I do not know how to use it in [DataSource()]
[TestClass()]
public class OperationsTests
{
private TestContext context;
public TestContext TestContext
{
get { return context; }
set { context = value; }
}
[DeploymentItem("1.xls")]
[DataSource("System.Data.Odbc", @"Dsn=Excel Files;dbq=.\1.xls;defaultdir=.;driverid=790;maxbuffersize=2048;pagetimeout=5", "Arkusz1$", DataAccessMethod.Sequential)]
[TestMethod()]
public void AddTest()
{
Operations target = new Operations();
int a = Int32.Parse(context.DataRow["A"].ToString());
int b = Int32.Parse(context.DataRow["B"].ToString());
int expected = Int32.Parse(context.DataRow["Wynik"].ToString());
int actual;
actual = target.Add(a, b);
Assert.AreEqual(expected, actual);
}
}