Пример #1
0
        public async void CheckGetTransaction_FromEmptyDbTable_ErrorHandlerIsCompletedFalse()
        {
            // arrange
            var transaction = GetTransaction();

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

            // assert
            Assert.False(statusMessage.IsCompleted);
        }
Пример #2
0
        public async Task <IActionResult> SingleItem(string key)
        {
            int id            = Int32.Parse(key);
            var statusMessage = await logicValidation.CheckGetSingleDataModelAsync(id);

            if (statusMessage.IsCompleted)
            {
                var model = await logic.GetSingleDataModelAsync(id);

                return(View(model));
            }
            else
            {
                return(View("CustomError", statusMessage));
            }
        }