Example #1
0
        public TurmaController()
        {
            var factory = new DatabaseFactory();

            var unitOfWork = new UnitOfWork(factory);

            var turmaRepository = new TurmaRepository(factory);

            _turmaService = new TurmaService(turmaRepository, unitOfWork);
        }
 public TurmaController()
 {
     _turmaService = new TurmaService(TurmaRepository, Uow);
 }
        public void Persistir_Turma_Service_Test()
        {
            var repo = Injection.Get<ITurmaRepository>();
            var uow = Injection.Get<IUnitOfWork>();
            var service = new TurmaService(repo, uow);

            service.Add(new TurmaDTO(ObjectBuilder.CreateTurma()));

            var turmas = service.GetAll();

            Assert.IsTrue(turmas.Count > 1);
            Assert.IsTrue((uow as Infrastructure.DAO.ORM.Common.EntityFrameworkUnitOfWork).Test() == (repo as NDDigital.DiarioAcademia.Infraestrutura.Orm.Repositories.TurmaRepositoryEF).Test());
        }