public void Should_be_in_a_unit_of_work() { var current = new StubUnitOfWork(); using(UnitOfWork.RegisterGlobalUnitOfWork(current)) { UnitOfWork.Start(); Assert.IsTrue(UnitOfWork.IsStarted); Assert.AreEqual(current, UnitOfWork.Current); } }
public void Should_be_to_get_the_current_unit_of_work() { using (UnitOfWork.RegisterGlobalUnitOfWork(new StubUnitOfWork())) { IUnitOfWork stub = new StubUnitOfWork(); UnitOfWork.RegisterGlobalUnitOfWork(stub); UnitOfWork.Start(); Assert.AreEqual(stub, UnitOfWork.Current); } }
public void Should_be_in_a_unit_of_work() { var current = new StubUnitOfWork(); using (UnitOfWork.RegisterGlobalUnitOfWork(current)) { UnitOfWork.Start(); Assert.IsTrue(UnitOfWork.IsStarted); Assert.AreEqual(current, UnitOfWork.Current); } }