We help IT Professionals succeed at work.


What is the best way to test a CRUD class in VB.NET.  I would like to use a database of test data so I can send loads of data to the class automatically rather than hard coding the tests.
Watch Question

Senior Software Engineer
Top Expert 2009
YOU can put your test data in a text or xml file. this file can go to source control as well. (I usually do not use a database engine as it makes the unit test to run slow.
In your setup method you load the file that contains your required tests and load them into memory.(myTests)
In your test methods you use myTests to fetch the test data.

Note: Your test data is made up of inputs and expected output.
The best way to get your head around is start defining your test data as variables in your current test class and then move the info to the file.