Exemple #1
0
        /// <summary>
        /// Set TestProperty's value
        /// </summary>
        protected virtual void ProtectedSetPropertyValue(TestProperty property, object value)
        {
            ValidateArg.NotNull(property, "property");

            if (property.ValidateValueCallback == null || property.ValidateValueCallback(value))
            {
                this.store[property] = value;
            }
            else
            {
                throw new ArgumentException(property.Label);
            }
        }
Exemple #2
0
        /// <summary>
        /// Set TestProperty's value
        /// </summary>
        protected virtual void ProtectedSetPropertyValue(TestProperty property, object value)
        {
            if (property is null)
            {
                throw new ArgumentNullException(nameof(property));
            }

            if (property.ValidateValueCallback == null || property.ValidateValueCallback(value))
            {
                this.store[property] = value;
            }
            else
            {
                throw new ArgumentException(property.Label);
            }
        }