protected virtual void OnFixtureSetUp() { InitializeIoC(); _unitOfWork = UnitOfWork.Start(); // create databases var sessions = new[] { UnitOfWork.GetCurrentSessionFor(typeof(DomainObjectFromDatabase1)), UnitOfWork.GetCurrentSessionFor(typeof(DomainObjectFromDatabase2)) }; for (int i = 0; i < sessions.Length; i++) { _schemas[i].Execute(false, true, false, sessions[i].Connection, null); } // insert test data and evict from session NHWith.Transaction(delegate { sessions[0].Evict(Repository <DomainObjectFromDatabase1> .Save(new DomainObjectFromDatabase1("foo"))); sessions[1].Evict(Repository <DomainObjectFromDatabase2> .Save(new DomainObjectFromDatabase2("bar"))); }); }
public void MultiTesting() { TestTool.RunTasks(4, () => NHWith.Transaction(delegate { Get(); FindAll_With_Paging(); GetByCategory(); })); }
public void MultiTest() { TestTool.RunTasks(4, () => NHWith.Transaction(delegate { FindAll(); FindAll_Paging(); Get(); })); }
public void ExecuteUpdateTransactonal() { NHWith.Transaction(delegate { ExecuteUpdate_Update(); // ExecuteUpdate_Delete(); ExecuteUpdate_Insert(); } ); }
public void ThreadSafeTest() { TestTool.RunTasks(4, () => NHWith.Transaction(IsolationLevel.ReadCommitted, delegate { FindAll_By_DetachedCriteria(); FindAll_By_Example_With_Criterion(); FindAll_By_Example(); }, UnitOfWorkNestingOptions.CreateNewOrNestUnitOfWork)); }
public void MultiTest() { TestTool.RunTasks(4, () => NHWith.Transaction(IsolationLevel.ReadCommitted, delegate { FindAll(); Get(); LazyLoad(); }, UnitOfWorkNestingOptions.CreateNewOrNestUnitOfWork)); }
public void CanEnterCachingMode() { // 기본적으로 Caching은 False이다. Assert.IsFalse(NHWith.Caching.Enabled); // Query Caching을 가능한 영역 using (NHWith.QueryCache()) { Assert.IsTrue(NHWith.Caching.Enabled); } Assert.IsFalse(NHWith.Caching.Enabled); }
public void NestingTransactions() { NHWith.Transaction(() => { FindAll_MatchingCriteria(); Exist_With_Criteria(); NHWith.Transaction(() => { Count_With_Criteria(); FindOne_With_Criterion(); }); DeleteAll(); }); }
public void TransactionTest() { NHWith.Transaction(FindAll_MatchingCriteria); }