示例#1
0
        public override ReturnValue IsValid(List <ISensor> allSensors)
        {
            var result = base.IsValid(allSensors);

            if (result?.Result != true)
            {
                return(result);
            }

            if (DefaultTimeoutInSec < 0)
            {
                return(ReturnValue.False("DefaultTimeoutInSec should not be less than 0"));
            }

            if (RequestMethod == null)
            {
                return(ReturnValue.False("Http Method should be specified"));
            }

            if (!(RequestMethod.CaseIgnoreEquals("HEAD") || RequestMethod.CaseIgnoreEquals("GET") || RequestMethod.CaseIgnoreEquals("POST")))
            {
                return(ReturnValue.False("Only HEAD, GET and POST operations are allowed"));
            }

            if (Urls == null || Urls.Count == 0)
            {
                return(ReturnValue.False("You need to select atleast one url to check"));
            }

            return(ReturnValue.True());
        }