public async void CheckUpdateTechProcess_FromEmptyDbTable_ErrorHandlerIsCompletedFalse()
        {
            // arrange
            var techProcess = GetTechProcess();

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

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

            statusMessage = logicValidation.ValidateModel(statusMessage, ModelState);
            if (statusMessage.IsCompleted)
            {
                await logic.UpdateDataModelAsync(model);

                await logProvider.AddToLogAsync($"Updated technological process information (Facility Id: {model.FacilityId}; Recipe Id: {model.RecipeId}).");

                return(RedirectToRoute(FacilityTechProcessesRouting.Index, new { key = model.FacilityId }));
            }
            else
            {
                return(View("CustomError", statusMessage));
            }
        }