mercredi 16 août 2017

real data or dummy data when NUnit Testinng

I have a Q regarding NUnit testing....so take the scenario where there is a list of 'Employees' and a list of 'AllStaffEver'....Employees holding all current employees and allStaffEver holding all staff that have ever worked for the company.

So i'm testing a case where records in allStaffEver have their column 'currentWorkingStatus' set to 'NotWorking'...which should remove them from the Employees....However a bug in the code shows allStaffEver with status set to 'NotWOrking' in the Employees list.

So my Q is when I am writing a unit test for this...should I test with the real database....grab the full list of employees...grab the full list of allStaffEver...update a record in allStaffEver and then do another pull of the all employees and compare.

Or Would I create a dummy list of say 3 employees...change the status in one of them and then check the dummy list again....

In the actual database there could be thousands of employees... What is the procedure for unit testing...is it always to create dummy data in the function or use real data?

Thanks for any answers

Aucun commentaire:

Enregistrer un commentaire