public void Deveria_Chamar_Servico_de_Buscar_Turma_Test() { //arrange TurmaRepository .Setup(x => x.GetById(It.IsAny <int>())) .Returns(ObjectBuilder.CreateTurma()); //act TurmaService.GetById(1); //assert TurmaRepository.Verify(x => x.GetById(It.IsAny <int>()), Times.Once()); }
// GET: api/Turma/5 public TurmaDTO Get(int id) { return(_turmaService.GetById(id)); }