This question is locked. New answers and comments are not allowed.
Hello,
In my automatic testing i want to be able to do several DB operations and after the test i like to revert the database to the original state.
Before with Entity Framework i was do it in this way:
[TestInitialize]
public void TestInitialize()
{
transactionScope = new TransactionScope(TransactionScopeOption.RequiresNew, new TimeSpan(0, 10, 0)); // original 5 min..
....
}
[TestCleanup]
public void TestCleanup()
{
transactionScope.Dispose(); // explicit controlled rollback!
}
so before every test it automatic start a new transactionscope, during testing i can do a lot of saving / manipulating of the Database and check if the results are as expected and on the end it will do the rollback off the database changes so that i am on the initial state again.
With Telerik DataAcess i dont know how i can do the same.. can you help me?
In my automatic testing i want to be able to do several DB operations and after the test i like to revert the database to the original state.
Before with Entity Framework i was do it in this way:
[TestInitialize]
public void TestInitialize()
{
transactionScope = new TransactionScope(TransactionScopeOption.RequiresNew, new TimeSpan(0, 10, 0)); // original 5 min..
....
}
[TestCleanup]
public void TestCleanup()
{
transactionScope.Dispose(); // explicit controlled rollback!
}
so before every test it automatic start a new transactionscope, during testing i can do a lot of saving / manipulating of the Database and check if the results are as expected and on the end it will do the rollback off the database changes so that i am on the initial state again.
With Telerik DataAcess i dont know how i can do the same.. can you help me?