Ejemplo n.º 1
0
        public void RunScript_GetErrorCode1_OptionObject2015_FormCountEquals0()
        {
            // Arrange
            OptionObject2015 optionObject = new OptionObject2015();

            // Act
            OptionObject2015 returnOptionObject = GetErrorCode1.RunScript(optionObject);

            // Assert
            Assert.AreEqual(0, returnOptionObject.Forms.Count);
        }
Ejemplo n.º 2
0
        public void RunScript_GetErrorCode1_OptionObject2015_ReturnsErrorCode0()
        {
            // Arrange
            OptionObject2015 optionObject = new OptionObject2015();

            // Act
            OptionObject2015 returnOptionObject = GetErrorCode1.RunScript(optionObject);

            // Assert
            Assert.AreEqual(1, returnOptionObject.ErrorCode);
        }
Ejemplo n.º 3
0
        public OptionObject RunScript(OptionObject optionObject, string parameter)
        {
            OptionObject returnOptionObject = new OptionObject();
            string       scriptName         = parameter != null?parameter.Split(',')[0] : "";

            logger.Debug("Script '" + scriptName + "' requested.");

            switch (scriptName)
            {
            case "GetErrorCode0":
                returnOptionObject = GetErrorCode0.RunScript(optionObject);
                logger.Debug("Script '" + scriptName + "' returned.");
                break;

            case "GetErrorCode1":
                returnOptionObject = GetErrorCode1.RunScript(optionObject);
                logger.Debug("Script '" + scriptName + "' returned.");
                break;

            case "GetErrorCode2":
                returnOptionObject = GetErrorCode2.RunScript(optionObject);
                logger.Debug("Script '" + scriptName + "' returned.");
                break;

            case "GetErrorCode3":
                returnOptionObject = GetErrorCode3.RunScript(optionObject);
                logger.Debug("Script '" + scriptName + "' returned.");
                break;

            case "GetErrorCode4":
                returnOptionObject = GetErrorCode4.RunScript(optionObject);
                logger.Debug("Script '" + scriptName + "' returned.");
                break;

            case "GetErrorCode5":
                returnOptionObject = GetErrorCode5.RunScript(optionObject);
                logger.Debug("Script '" + scriptName + "' returned.");
                break;

            case "GetErrorCode6":
                returnOptionObject = GetErrorCode6.RunScript(optionObject);
                logger.Debug("Script '" + scriptName + "' returned.");
                break;

            case "GetFieldValue":
                returnOptionObject = GetFieldValue.RunScript(optionObject, parameter);
                logger.Debug("Script '" + scriptName + "' returned.");
                break;

            case "SetFieldValue":
                returnOptionObject = SetFieldValue.RunScript(optionObject, parameter);
                logger.Debug("Script '" + scriptName + "' returned.");
                break;

            default:
                logger.Warn("ScriptName '" + scriptName + "' does not match an existing script.");
                returnOptionObject = DefaultScript.RunScript(optionObject, scriptName);
                break;
            }

            return(returnOptionObject);
        }