public bool ValidateEnvNameByGivingLargeLength(string envName, out string msg) { msg = ""; try { if (ValidateEnvironmentName(envName, out string Outmessage)) { if (Outmessage.Length > 255)//matching name >255 characters { if (Outmessage.Contains("ORA-12899: value too large for column")) { msg = "Successfully verified error message for Name more than 255 characters: " + Outmessage + " " + "Expected error message:\"ORA-12899: value too large for column \"OE_11\".\"LN_ORGANIZATIONS\".\"NAME\";" + ";Actual error message: " + Outmessage; return(true); } } } throw new Exception("Failed to match error message Refer screenshot for more info"); } catch { throw new Exception("Failed to validate environment name parameter Refer screenshot for more info"); } }
public bool ValidateEnvNameByGivingNumericValuesOrSpaceOrSpecialCharacters(string envName, out string message) { message = ""; try { if (ValidateEnvironmentName(envName, out string Outmessage)) { if (Regex.IsMatch(envName, "^\\d+") || Regex.IsMatch(envName, "^[^a-zA-Z0-9]+$") || Regex.IsMatch(envName, "^[a-zA-Z0-9 ]*$"))//matching numeric, name with space and special characters { if (Outmessage.Equals("No spaces or special characters allowed, and must start with non-numeric.")) { message = "Successfully verified error message for " + envName + "; " + "Expected error message:\"No spaces or special characters allowed, and must start with non-numeric.\";" + "Actual error message : \"" + message + "\""; return(true); } } } throw new Exception("Failed to match error message Refer screenshot for more info"); } catch { throw new Exception("Failed to validate environment name parameter Refer screenshot for more info"); } }
public bool ValidateOrgNameByGivingEmptyOrSpace(string value, out string message) { try { message = ""; if (ValidateOrganizationName(value, out string Outmessage)) { if (Regex.IsMatch(value, "^\\s+") || value.Contains("")) //matching name for empty and space values { if (Outmessage.Equals("Required field.") || Outmessage.Equals("No spaces or special characters allowed, and must start with non-numeric.")) { message = "Successfully verified error message for empty/space characters; " + "Expected error message:\"Required field.\"; " + "Actual error message : \"" + Outmessage + "\""; return(true); } } } throw new Exception("Failed to match error message Refer screenshot for more info"); } catch { throw new Exception("Failed to validate organization name parameter Refer screenshot for more info"); } }