public void Delete_WithExistingModel_ShouldRemoveStorageOption() { SetUp(); SeedData(); var sorageOption = _context.StorageOptions.First(); _storageOptionService.Delete(sorageOption.StorageOptionId); Assert.DoesNotContain(sorageOption, _context.StorageOptions); }
public IActionResult DeleteConfirmed(int id) { var storage = _service.GetStorageOptionById(id); string imgUrl = storage.ImgUrl; if (imgUrl != Constants.DEFAULT_STORAGE_IMG) { _driveService.DeleteFile(imgUrl); } _service.Delete(id); return(RedirectToAction(nameof(Index))); }