Ejemplo n.º 1
0
        public async void CheckUpdateTransaction_FromEmptyDbTable_ErrorHandlerIsCompletedFalse()
        {
            // arrange
            var transaction = GetTransaction();

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

            // assert
            Assert.False(statusMessage.IsCompleted);
        }
Ejemplo n.º 2
0
        public async Task <IActionResult> EditSingleItem(TransactionBatch model)
        {
            var statusMessage = await logicValidation.CheckUpdateDataModelAsync(model);

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

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

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