public async Task ReaderService_DeleteByIdAsync_DeleteModel() { //arrange int readerId = 1; var mockUnitOfWork = new Mock <IUnitOfWork>(); mockUnitOfWork.Setup(m => m.ReaderRepository.DeleteByIdAsync(It.IsAny <int>())); var readerService = new ReaderService(mockUnitOfWork.Object, UnitTestHelper.CreateMapperProfile()); //act await readerService.DeleteByIdAsync(readerId); //assert mockUnitOfWork.Verify(x => x.ReaderRepository.DeleteByIdAsync(readerId), Times.Once); mockUnitOfWork.Verify(x => x.SaveAsync(), Times.Once); }