Код: Выделить всё
[TestClass]
public class TransactionAsyncTest
{
private TransactionScope? _scope;
[TestInitialize]
public void TestInitialize()
{
_scope = new TransactionScope(TransactionScopeOption.Required, TransactionScopeAsyncFlowOption.Enabled);
}
[TestMethod]
public void Test()
{
Assert.IsNotNull(Transaction.Current);
}
[TestCleanup]
public void TestCleanup()
{
_scope?.Dispose();
}
}
Подробнее здесь: https://stackoverflow.com/questions/797 ... lize-async
Мобильная версия