Example #1
0
        public async void CheckOpenTransaction_FromEmptyDbTable_ErrorHandlerIsCompletedFalse()
        {
            // arrange
            var transaction = GetTransaction();

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

            // assert
            Assert.False(statusMessage.IsCompleted);
        }
Example #2
0
        public async Task <IActionResult> OpenTransaction(string key)
        {
            int id            = Int32.Parse(key);
            var statusMessage = await logicValidation.CheckOpenTransactionAsync(id);

            if (statusMessage.IsCompleted)
            {
                await logic.OpenTransactionAsync(id);

                await logProvider.AddToLogAsync($"Opened transaction (Id: {key}).");

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