public async Task DeleteAsync_WhenCalled_InvokesRepositoryDeleteMethod() { // Arrange var busStation = new BusStationModel(); // Act await _busStationService.DeleteAsync(1); // Assert _mockAsyncRepository.Verify(m => m.DeleteAsync(It.IsAny <MasterBusStation>()), Times.Once); }
public async Task <IActionResult> DeleteConfirmed(int id) { await _busStationService.DeleteAsync(id); return(RedirectToAction(nameof(Index))); }