public void Validate_ValidMaxAge_NoException()
        {
            var config = new HstsConfiguration {
                MaxAge = new TimeSpan(1)
            };

            Assert.DoesNotThrow(() => _validator.Validate(config));
        }
Exemple #2
0
        public void Validate_ValidMaxAge_NoException()
        {
            var config = new HstsConfiguration {
                MaxAge = new TimeSpan(1)
            };

            _validator.Validate(config);
        }
Exemple #3
0
        public override void Validate(object value)
        {
            var hstsConfig = (HstsConfigurationElement)value;

            var validator = new HstsConfigurationValidator();

            try
            {
                validator.Validate(hstsConfig);
            }
            catch (Exception e)
            {
                throw new ConfigurationErrorsException("HSTS configuration error. Details: " + e.Message, e);
            }
        }