Exemplo n.º 1
0
            public void Open_A_New_Transaction()
            {
                var uow = new NHibernateUnitOfWork(_mockSession.Object, IsolationLevel.ReadUncommitted);

                _mockSession.Verify(ms => ms.BeginTransaction(It.IsAny<IsolationLevel>()));
                uow.Dispose();
            }
Exemplo n.º 2
0
            public void Save_Session_For_Reuse()
            {
                var uow = new NHibernateUnitOfWork(_mockSession.Object);

                Assert.AreSame(uow.Session, _mockSession.Object);
                uow.Dispose();
            }
Exemplo n.º 3
0
 public void Commit_Transaction_When_Called()
 {
     using (var uow = new NHibernateUnitOfWork(_mockSession.Object, IsolationLevel.ReadUncommitted))
     {
         uow.Commit();
         _mockTransaction.Verify(mt => mt.Commit());
     }
 }
Exemplo n.º 4
0
            public void Use_IsolationLevel_Of_ReadCommitted_By_Default()
            {
                var uow = new NHibernateUnitOfWork(_mockSession.Object);

                _mockSession.Verify(ms => ms.BeginTransaction(IsolationLevel.ReadCommitted));
                uow.Dispose();
            }
Exemplo n.º 5
0
 public void Throw_If_Session_Is_Null()
 {
     var uow = new NHibernateUnitOfWork(null);
 }