private static ValidationResult RunValidationStep(IValidationStep validationStep, int currentStep, int totalSteps) { Console.WriteLine($"\tValidation step {currentStep}/{totalSteps}: {validationStep.ComponentName}"); var validationResult = validationStep.Run(); var validationOutcome = validationResult.IsSuccessful ? Constants.Texts.Validation.ValidationStepSuccessfulText : $"\tValidation step failed. Error(s): {validationResult.Message}"; Console.WriteLine(validationOutcome); return(validationResult); }
private ValidationResult RunValidationStep(IValidationStep validationStep, Table asciiTable) { var validationResult = validationStep.Run(); if (validationResult.IsSuccessful) { asciiTable.AddRow(validationStep.ComponentName, "Success", "Everything is well-configured."); } else { asciiTable.AddRow(validationStep.ComponentName, "Failed", $"Validation failed:\r\n{validationResult.Message}"); } return(validationResult); }
private ValidationResult RunValidationStep(IValidationStep validationStep, int currentStep, int totalSteps) { _validationLogger.LogInformation("Start Validation step {currentStep}/{totalSteps}: {validationStepName}", currentStep, totalSteps, validationStep.ComponentName); var validationResult = validationStep.Run(); if (validationResult.IsSuccessful) { _validationLogger.LogInformation("Validation step {currentStep}/{totalSteps} succeeded", currentStep, totalSteps); } else { _validationLogger.LogWarning("Validation step {currentStep}/{totalSteps} failed. Error(s): {validationMessage}", currentStep, totalSteps, validationResult.Message); } return(validationResult); }