0

I am using Visual Studio to test some insert and delete methods in the database. I need to have separate testing methods for the insert and delete methods.

My problem is that I can't test either of the methods if one of them doesn't work. I can't have duplicate entries in the database and I should have a fixed entry that I insert in the database and that same entry should be deleted when I test the delete method.

Is there a best practice for such test that depend on each other?

1 Answer 1

1

if you want you tests to go to the database, then you could pre-populate the database with known data.

as you execute your logic, you can ensure the state of the db has changed correctly.

a lib already exists to help https://code.google.com/p/ndbunit/

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.