コード例 #1
0
        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;
        }
コード例 #2
0
        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();
        }
コード例 #3
0
        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());
        }