NUnit 3, Generating test on the fly with CSV

265 views
Skip to first unread message

Milindu Sanoj Kumarage

unread,
Nov 16, 2015, 9:18:26 AM11/16/15
to NUnit-Discuss
Hi,

Can I generate new tests on the fly from the written tests by using a CSV file?

In the following article, it shows how to build a test suite with tests for each row of a database query result. But this is for NUnit 2.4.6. How can I do this with NUnit 3.0? 


Thanks,
Milindu.

Rob Prouse

unread,
Nov 16, 2015, 9:39:19 AM11/16/15
to NUnit-Discuss
Extending NUnit is much easier now, unfortunately, our documentation needs to be updated with examples. You would extend NUnit by writing new attributes the exact same way that they are written in the framework itself. The best examples are actually in the NUnit source code. Just take a look at the source for an attribute that does something similar to what you want to do.

That said, you probably don't need to extend NUnit to read test data from a CSV file. You could use the TestCaseSource attribute where the source reads in the CSV and returns the values you want to use for your tests. See https://github.com/nunit/nunit/wiki/TestCaseSource-Attribute for more information.



--
You received this message because you are subscribed to the Google Groups "NUnit-Discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to nunit-discus...@googlegroups.com.
To post to this group, send email to nunit-...@googlegroups.com.
Visit this group at http://groups.google.com/group/nunit-discuss.
For more options, visit https://groups.google.com/d/optout.



--

Rob Prouse

 

I welcome VSRE emails. Learn more at http://vsre.info/

Reply all
Reply to author
Forward
0 new messages