I have googled this a little and didn\'t really find the answer I needed.
I am working on a webpage in C# with SQL Server and LINQ for a customer. I want the users
Do all the test inside of a System.Transactions.TransactionScope block, and simply do not call Scope.Complete() ... All changes will be rolled back when you exit, and other users will not be able to see the temporary data you create in the database, so the test process will only affect the test machine..
You can enter a new user, read the database to verify that it was entered correctly, and whatever else you need to check, within the block of the TransactionScope...
Have the single unit test method impersonate the two different users, all within the one transaction ...
e.g. code
using (var scop = new System.Transactions.TransactionScope())
{
// all your test code and Asserts that access the database,
// writes and reads, from any class, ...
// to commit at the very end of this block,
// you would call
// scop.Complete(); // ..... but don't and all will be rolled back
}