public List <TurmaViewModel> Search(TurmaSearchModel searchModel) { var Turmas = TurmaRepository.GetAll(); return(Filter(Turmas, searchModel).Select(selectClauseTurma).ToList()); }
public void Deveria_Persistir_Turma_ORM_Test() { var turma = ObjectBuilder.CreateTurma(); TurmaRepository.Add(turma); Uow.Commit(); var qtdTurmas = TurmaRepository.GetAll().Count; Assert.AreEqual(2, qtdTurmas); }
public void Deveria_Persistir_Turma_SQL_Test() { var turma = ObjectBuilder.CreateTurma(); var qtdTurmasBefore = TurmaRepository.GetAll().Count; TurmaRepository.Add(turma); var qtdTurmasAfter = TurmaRepository.GetAll().Count; Uow.Commit(); Assert.AreEqual(qtdTurmasBefore + 1, qtdTurmasAfter); }
public void Deveria_Remover_Turma_SQL_Test() { var turma = ObjectBuilder.CreateTurma(); TurmaRepository.Add(turma); Uow.Commit(); var qtdTurmasBefore = TurmaRepository.GetAll().Count; TurmaRepository.Delete(turma.Id); Uow.Commit(); var qtdTurmasAfter = TurmaRepository.GetAll().Count; Assert.AreEqual(qtdTurmasBefore - 1, qtdTurmasAfter); }
public void Deveria_Remover_Turma_ORM_Test() { var turma = ObjectBuilder.CreateTurma(); TurmaRepository.Add(turma); Uow.Commit(); var turmasEncontradas = TurmaRepository.GetAll(); Assert.AreEqual(2, turmasEncontradas.Count); TurmaRepository.Delete(2); Uow.Commit(); turmasEncontradas = TurmaRepository.GetAll(); Assert.AreEqual(1, turmasEncontradas.Count); }
public async Task <ActionResult <List <Turma> > > GetAll([FromServices] EscolaDataContext context) { var turmas = await repository.GetAll(); return(turmas); }
public void Deveria_Buscar_Todas_Turmas_SQL_Test() { var turmasEncontradas = TurmaRepository.GetAll(); Assert.IsTrue(turmasEncontradas.Count > 0); }
public void Deveria_Buscar_Todas_Turmas_ORM_Test() { var turmasEncontradas = TurmaRepository.GetAll(); Assert.AreEqual(1, turmasEncontradas.Count); }