public void ValidateEnvironmentName_InvalidSpaceString() { bool isValid = _validator.ValidateEnvironmentName("Environment 2"); Assert.IsFalse(isValid); Assert.IsTrue(_validator.ErrorMessages.Any()); }
/// <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); }