コード例 #1
0
        public void Deveria_Chamar_Servico_de_Remover_Aluno_Test()
        {
            //arrange
            AlunoRepository
            .Setup(x => x.Delete(It.IsAny <int>()));

            //act
            AlunoService.Delete(1);

            UnitOfWork.Setup(x => x.Commit());

            //assert
            AlunoRepository.Verify(x => x.Delete(It.IsAny <int>()), Times.Once());

            UnitOfWork.Verify(x => x.Commit(), Times.Once());
        }
コード例 #2
0
 // DELETE: api/Aluno/5
 public IHttpActionResult Delete(int id)
 {
     _alunoService.Delete(id);
     return(Ok());
 }