コード例 #1
0
        public IActionResult DeleteConfirmed(int id)
        {
            var caminhao = _caminhaoService.GetById(id);

            _caminhaoService.Delete(caminhao);
            return(RedirectToAction(nameof(Index)));
        }
コード例 #2
0
        public async Task Delete_ShouldDelete()
        {
            //Arrange
            var id = Guid.NewGuid();

            //Act
            await _caminhaoService.Delete(id);

            //Assert
            _caminhaoRepositoryMoq.Verify(v => v.Delete(id), Times.Once);
        }