public async void CheckRemoveOperation_FromEmptyDbTable_ErrorHandlerIsCompletedFalse() { // arrange var operation = GetOperation(); // act var statusMessage = await logicValidation.CheckRemoveDataModelAsync(operation.Id); // assert Assert.False(statusMessage.IsCompleted); }
public async Task <IActionResult> DeleteSingleItem(Operation model) { var statusMessage = await logicValidation.CheckRemoveDataModelAsync(model.Id); if (statusMessage.IsCompleted) { await logic.RemoveDataModelAsync(model); await logProvider.AddToLogAsync($"Removed operation (Id: {model.Id})."); return(RedirectToRoute(TransactionsRouting.SingleItem, new { key = model.TransactionId })); } else { return(View("CustomError", statusMessage)); } }