How to make Unit Tests to make sure stored procedure is deleting row from the database?

Posted by aspdotnetuser on Programmers See other posts from Programmers or by aspdotnetuser
Published on 2012-07-11T14:15:53Z Indexed on 2012/07/11 15:22 UTC
Read the original article Hit count: 265

Filed under:
|

I'm new to unit testing and I need some help with the following.

I have created a small project to help me learn how to make Unit Tests. The functionality for one of the forms in my application deletes a user from the User table (and other rows in mapping tables).

Currently, the unit test I have created to test this sets up the required objects and then calls the business rules method (passing in the user id) which calls the data access method to execute the stored procedure that deletes the rows in the tables.

Is this the correct method to test whether something is being deleted successfully? Should the unit test / setup method first insert some test data which the unit test then deletes?

© Programmers or respective owner

Related posts about c#

Related posts about unit-testing