NivNavick/trxer

Not Listing DataDriven Tests

Opened this issue · 1 comments

ZcuBa commented

So A test method could look like this:

`
public TestContext TestContext { get; set; }

    [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);
    }

`

with a datafile like this:

id,source,target,comment
0, "2x^2+x" ,0;1;2,
1, " 2x^2 + 1.0x " ,0;1;2,
2, "2x^2 + 1.0
x + 0" ,0;1;2,
3, "2u^3 + u " ,0;1;0;2

`this actually prduces 4 runs of datadriven tests, for this test method.
this is not shown in the html.

I have the same problem. Can you help us @NivNavick ?

Thank you!