Data-driven testing in NUnit?

前端 未结 5 1767
情歌与酒
情歌与酒 2020-12-14 03:40

In MSTest you can do something like:

[TestMethod]
[DataSource(\"Microsoft.VisualStudio.TestTools.DataSource.CSV\", 
            \"testdata.csv\", \"testdata#         


        
5条回答
  •  长情又很酷
    2020-12-14 04:08

    I would look at the parameterized tests documentation in NUnit 2.5 and see if you can do something like what you're doing there. I do not recall NUnit having a built-in CSV reading attribute to drive parameterized tests. There may be a community plug-in somewhere though.

    I should also point out that if you are just looking for non-MS Unit Testing framework libraries to help you out, xUnit.net does have this functionality. Check out this blog post from Ben Hall

提交回复
热议问题