public void ValidateEntryFileName_ValidFullPath()
        {
            bool isValid = _validator.ValidateAppFilePath("C:\\fadsf asd\\Hello.exe");

            Assert.IsTrue(isValid);
            Assert.IsTrue(!_validator.ErrorMessages.Any());
        }
Beispiel #2
0
        /// <summary>
        /// Validates the input.
        /// </summary>
        /// <returns></returns>
        private bool ValidateInput()
        {
            _validator.ErrorMessages.Clear();
            _validator.ValidateAppName(this.ServiceAppNameTextBox.Text);
            _validator.ValidateStartupType((Enums.StartupType) this.StartupTypeComboBox.SelectedValue);
            _validator.ValidateEnvironmentName(this.ServiceAppEnvironmentTextBox.Text);
            _validator.ValidateDescription(this.DescriptionTextBox.Text);
            _validator.ValidateAppFilePath(this.AppFilePathTextBox.Text);
            _validator.ValidateSchedule(this.ScheduleHiddenLabel.Text);

            if (_validator.ErrorMessages.Any())
            {
                MessageBox.Show("• " + string.Join(Environment.NewLine + "• ", _validator.ErrorMessages), "The following validation errors occured", MessageBoxButton.OK, MessageBoxImage.Error);
                return(false);
            }

            return(true);
        }