I am trying to do automated web testing of my ASP.NET application. I was hoping to use the AutoRollback attribute from the Xunit.net extensions to undo any database changes that were made during the test. AutoRollback uses TransactionScope to start a transaction before a test and roll back.
When I try to hit my web application during a transaction, it always expires. It seems that this should work, some ideas? Here is my test:
[Fact] [AutoRollback] public void Entity_should_be_in_list() { Entity e = new Entity { Name = "Test", }; dataContext.Entities.InsertOnSubmit(e); dataContext.SubmitChanges(); selenium.Open("http://localhost/MyApp"); Assert.True(selenium.IsTextPresent("Test")); }
Robin flowers
source share