public static OptionObject2 RunScript(OptionObject2 optionObject, string parameter) { string[] parameters = parameter.Split(','); string fieldNumber = parameters.Length >= 2 ? parameters[1] : ""; string returnMessage = "The FieldValue is "; if (optionObject.IsFieldPresent(fieldNumber)) { returnMessage += optionObject.GetFieldValue(fieldNumber); } returnMessage += ". Since no FieldObjects were modified, no Forms should be returned."; return(optionObject.ToReturnOptionObject(ErrorCode.Informational, returnMessage)); }
public void OptionObject2_ReturnOptionObject_ServerNameReturned() { List <FieldObject> fieldObjects = new List <FieldObject> { new FieldObject("123", "Test") }; RowObject rowObject = new RowObject("1||1", fieldObjects); FormObject formObject = new FormObject("1", rowObject); OptionObject2 optionObject = new OptionObject2("USER00", "userId", "000111", "1", "123456", 1, "UAT", "AVPM", "AVPM", "SERVER"); optionObject.AddFormObject(formObject); OptionObject2 returnOptionObject = optionObject.ToReturnOptionObject(); Assert.AreEqual(optionObject.ServerName, returnOptionObject.ServerName); }
public static OptionObject2 RunScript(OptionObject2 optionObject, string parameter) { if (optionObject.IsFieldPresent("123")) { string fieldValue = optionObject.GetFieldValue("123"); if (string.IsNullOrEmpty(fieldValue)) { fieldValue = "I have set the FieldValue."; } else { fieldValue += " (I have appended the FieldValue.)"; } optionObject.SetFieldValue("123", fieldValue); } return(optionObject.ToReturnOptionObject(ErrorCode.Success, "If FieldNumber 123 is found in OptionObject, then it should be the only FieldObject returned. Otherwise, no Forms should be returned.")); }
public void OptionObject2_ReturnOptionObject_AreNotEqual() { List <FieldObject> fieldObjects = new List <FieldObject> { new FieldObject("123", "Test") }; RowObject rowObject = new RowObject("1||1", fieldObjects); FormObject formObject = new FormObject("1", rowObject); OptionObject2 optionObject = new OptionObject2("USER00", "userId", "000111", "1", "123456", 1, "UAT", "AVPM", "AVPM", "SERVER"); optionObject.AddFormObject(formObject); OptionObject2 returnOptionObject = optionObject.ToReturnOptionObject(); Assert.AreNotEqual(optionObject, returnOptionObject); Assert.IsTrue(optionObject.IsFieldPresent("123")); Assert.IsFalse(returnOptionObject.IsFieldPresent("123")); }
public static OptionObject2 RunScript(OptionObject2 optionObject) { return(optionObject.ToReturnOptionObject(ErrorCode.Warning, "The code means the RunScript is providing a warning requiring a response from the user.")); }
public static OptionObject2 RunScript(OptionObject2 optionObject) { return(optionObject.ToReturnOptionObject(ErrorCode.Informational, "The code means the RunScript was successful, however is providing an alert or informational notice.")); }
public static OptionObject2 RunScript(OptionObject2 optionObject) { return(optionObject.ToReturnOptionObject(ErrorCode.Confirm, "The code means the RunScript is prompting a confirmation.")); }
public static OptionObject2 RunScript(OptionObject2 optionObject) { return(optionObject.ToReturnOptionObject(ErrorCode.Success, "The code means the RunScript was successful.")); }
public static OptionObject2 RunScript(OptionObject2 optionObject) { return(optionObject.ToReturnOptionObject(ErrorCode.OpenUrl, "https://rarelysimple.com")); }
public static OptionObject2 RunScript(OptionObject2 optionObject) { return(optionObject.ToReturnOptionObject(ErrorCode.Error, "The code means the RunScript experienced an Error and to stop processing.")); }
public static OptionObject2 RunScript(OptionObject2 optionObject, string scriptName) { return(optionObject.ToReturnOptionObject(ErrorCode.Alert, "No script was found with the name '" + scriptName + "'.")); }
public static OptionObject2 RunScript(OptionObject2 optionObject) { return(optionObject.ToReturnOptionObject(ErrorCode.OpenForm, "[PM]USER100")); }