I have a WCF REST service. I would like to write integration tests for the operations. I was thinking to write those by using HttpWebRequest (as described in Why does my C# client, POSTing to my WCF REST service, return (400) Bad Request?).
My question is: can I put the HttpWebRequest code in a transactionscope, so that any database operations are rolled back after execution, like:
using (var scope = new TransactionScope(TransactionScopeOption.Required))
{
// use HttpWebRequest to execute REST service operation
}
Would this work?