public int AddPool(int ruleId) { var pool = new Pool { iRuleID = ruleId, bIsActive = true, dtStartTime = DateTime.Now }; Uow.Pools.Add(pool); Uow.Commit(); return pool.iPoolID; }
public void Initialize() { _scope = new TransactionScope(); _rule = new Rule(); _uow.Rules.Add(_rule); _uow.Commit(); _pool = new Pool {iRuleID = _rule.iRuleID, dtStartTime = DateTime.Now}; _uow.Pools.Add(_pool); _uow.Commit(); _message = new Message(); _uow.Messages.Add(_message); _uow.Commit(); }
public void DeactivatePool_UpdatesPoolAndCommits() { var pool = new Pool() { iPoolID = 1, bIsActive = true }; MockRepoPool.Setup(x => x.GetById(1)).Returns(pool); PoolService.DeactivatePool(1); Assert.AreEqual(false, pool.bIsActive); MockRepoPool.Verify(x => x.Update(pool)); MockUow.Verify(x => x.Commit()); }