Beispiel #1
0
        public async void CheckUpdateOperation_FromEmptyDbTable_ErrorHandlerIsCompletedFalse()
        {
            // arrange
            var operation = GetOperation();

            // act
            var statusMessage = await logicValidation.CheckUpdateDataModelAsync(operation);

            // assert
            Assert.False(statusMessage.IsCompleted);
        }
Beispiel #2
0
        public async Task <IActionResult> EditSingleItem(Operation model)
        {
            var statusMessage = await logicValidation.CheckUpdateDataModelAsync(model.Id);

            if (statusMessage.IsCompleted)
            {
                await logic.UpdateDataModelAsync(model);

                await logProvider.AddToLogAsync($"Updated operation information (Id: {model.Id}).");

                return(RedirectToRoute(TransactionsRouting.SingleItem, new { key = model.TransactionId }));
            }
            else
            {
                return(View("CustomError", statusMessage));
            }
        }