You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[TestMethod]
[DataSource("Microsoft.VisualStudio.TestTools.DataSource.CSV", @"|DataDirectory|\DataFiles\PolynomialParseTests.csv", "PolynomialParseTests#csv", DataAccessMethod.Sequential)]
public void PolynomialParsing()
{
string source = (string)TestContext.DataRow["source"]; // get the value from the 'input polynomial string' column
string target = (string)TestContext.DataRow["target"]; // get the value from the 'expected' coeffecients column
Polynomial P = new Polynomial();
P.Parse(source);
string[] coeffecients = target.Trim().Split(';');
List<double> C = coeffecients.Select(c => double.Parse(c, CultureInfo.InvariantCulture)).ToList();
CollectionAssert.AreEqual(C, P.P);
}
So A test method could look like this:
`
public TestContext TestContext { get; set; }
`
with a datafile like this:
`this actually prduces 4 runs of datadriven tests, for this test method.
this is not shown in the html.
The text was updated successfully, but these errors were encountered: