public async void CheckRemoveProductCatalog_FromInitializedDbTable_ErrorHandlerIsCompletedTrue() { // arrange var productCatalog = GetProductCatalog(); fixture.db.Add(productCatalog); await fixture.db.SaveChangesAsync(); // act var statusMessage = await logicValidation.CheckRemoveDataModelAsync(productCatalog.Id); // assert Assert.True(statusMessage.IsCompleted); }
public async Task <IActionResult> DeleteSingleItem(string key) { int id = Int32.Parse(key); var statusMessage = await logicValidation.CheckRemoveDataModelAsync(id); if (statusMessage.IsCompleted) { await logic.RemoveDataModelAsync(id); await logProvider.AddToLogAsync($"Removed product from catalog (Id: {key})."); return(RedirectToRoute(ProductsCatalogRouting.Index)); } else { return(View("CustomError", statusMessage)); } }