Exemple #1
0
        public void TesteObterTodosAIniciarHoje()
        {
            InitializaNinject();

            var pactoAIniciar1 = MontarPactoParaTeste(DateTime.Today, DateTime.Today.AddDays(10), eSituacaoPacto.AIniciar, "4132213");
            var pactoAIniciar2 = MontarPactoParaTeste(DateTime.Today, DateTime.Today.AddDays(20), eSituacaoPacto.AIniciar, "123451231234");

            _uow.BeginTransaction();
            pactoAIniciar1 = _pactoService.Adicionar(pactoAIniciar1);
            pactoAIniciar2 = _pactoService.Adicionar(pactoAIniciar2);
            _uow.Commit();


            var pactosIniciandoHoje = _pactoService.ObterTodosAIniciarHoje().ToList();

            Assert.IsTrue(pactosIniciandoHoje.Count(p => p.IdPacto == pactoAIniciar1.IdPacto) > 0);
            Assert.IsTrue(pactosIniciandoHoje.Count(p => p.IdPacto == pactoAIniciar2.IdPacto) > 0);
        }
Exemple #2
0
        public void IniciarAutomaticamente()
        {
            BeginTransaction();
            var pactosQueIniciamHoje = _pactoService.ObterTodosAIniciarHoje();

            pactosQueIniciamHoje.ToList().ForEach(p =>
            {
                _pactoService.IniciarPacto(p);
            });
            Commit();
        }