using System;
using System.Data;
using NUnit.Framework;
using BLToolkit.Data;
namespace HowTo.Data
{
[TestFixture]
public class Transaction
{
[Test]
public void Test1()
{
using (DbManager db = new DbManager())
{
db.BeginTransaction();
// ...
db.CommitTransaction();
}
}
[Test]
public void Test2()
{
using (DbManager db = new DbManager())
{
db.BeginTransaction(IsolationLevel.ReadCommitted);
// ...
db.CommitTransaction();
}
}
}
} |