Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Not Listing DataDriven Tests #32

Open
ZcuBa opened this issue Apr 26, 2017 · 1 comment
Open

Not Listing DataDriven Tests #32

ZcuBa opened this issue Apr 26, 2017 · 1 comment

Comments

@ZcuBa
Copy link

ZcuBa commented Apr 26, 2017

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.

@bernapinto
Copy link

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

Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants