Beispiel #1
0
        public CheckStatus ExecuteCheck(Check check, IIQObject activeObject)
        {
            CheckStatus checkStatus = CheckStatus.Completed;

            log.Debug(">ExecuteCheck");

            try
            {
                switch (check.Condition)
                {
                case "mustHaveLinkWith":
                    checkStatus = IIQHelper.CheckMustHaveLinkWith(activeObject.Id, check.Value) ? CheckStatus.Completed : CheckStatus.Pending;
                    break;

                case "xpathMustMatch":
                    checkStatus = IIQHelper.CheckXpathMustMatch(activeObject.Id, check.Value) ? CheckStatus.Completed : CheckStatus.Pending;
                    break;
                }

                log.Debug("<ExecuteCheck");

                return(checkStatus);
            }
            catch (Exception ex)
            {
                log.Error($"Check error: {check.ToString()}. Exception message: {ex.Message}");
                return(CheckStatus.Error);
            }
        }
Beispiel #2
0
 private void InitializeActiveObject(bool force = false)
 {
     if (!string.IsNullOrEmpty(this.resultObjectId))
     {
         if (force || this._activeObject == null)
         {
             this._activeObject = IIQHelper.GetIIQObjectAttributes(this.resultObjectId);
         }
     }
 }
Beispiel #3
0
        public bool SetActiveObject(string objectId)
        {
            log.Debug(">SetActiveObject");

            Dictionary <string, string> activeObject = IIQHelper.GetIIQObjectAttributes(objectId);

            if (activeObject != null && activeObject.Count > 0)
            {
                this.resultObjectId = objectId;
                this._activeObject  = activeObject;
                return(true);
            }
            else
            {
                return(false);
            }
        }