Following code is used to inject data to the unit test from a CSV file.
[DataSource("Microsoft.VisualStudio.TestTools.DataSource.CSV", "|DataDirectory|\CalculatePowerInputFraction05.csv", "CalculatePowerInputFraction05#csv", DataAccessMethod.Sequential), DeploymentItem("Simulation.Test\CalculatePowerInputFraction05.csv"), TestMethod]
public void CalculatePowerTest3() { }
I am setting the above properties by
Right Click on the test in test view -> Properties -> Connection String -> Choose CSV file
The problem I am facing is, |DataDirectory| contains absolute path. I am unable to run the tests in any other system. Is there any other way to provide input to TestContext so that problem with absolute path can be solved by giving relative path?