NUnit testing with atomicity
-
hi, have been searching around for quite a while on this but have been having trouble locating an explanation. i've read all over that unit tests need to be runnable independently from other code. this makes sense to me but my question is what to do with re-usable code? for example: i have 4 tests: CreateUserTest : i create a user object in the db DeleteUserTest: here, i want to create a user, then delete that user. so i re-use the code in the first test. CreateGroupTest: Creates a group in the db AddUserToGroupTest: this is another reusability example. here, i run the "CreateGroupTest", "CreateUserTest","AddUserToGroupTest" i can run each test individually and in any order. (which is good) is something wrong with this type of reusability? i have everything as seperate tests in one test fixture with one setup and one teardown. Any thoughts?