internal override void ValidateElement <T>(CspDirectiveBaseConfigurationElement <T> element)
        {
            if (element.NoneSrc && element.UnsafeInlineSrc)
            {
                throw new ConfigurationErrorsException("Both \"None\" and \"UnsafeInline\" are enabled. \"None\" cannot be combined with other sources");
            }

            base.ValidateElement(element);
        }
        internal virtual void ValidateElement <T>(CspDirectiveBaseConfigurationElement <T> element) where T : CspSourceConfigurationElement, new()
        {
            if (element.NoneSrc && element.Sources.Count > 0)
            {
                throw new ConfigurationErrorsException("Other sources are not allowed when \"None\" is enabled. Disable \"None\" or remove other sources.");
            }

            if (element.NoneSrc && element.SelfSrc)
            {
                throw new ConfigurationErrorsException("Both \"None\" and \"Self\" are enabled. \"None\" cannot be combined with other sources");
            }
        }
 public void TestInitialize()
 {
     _validator     = new CspDirectiveBaseConfigurationElementValidator();
     _configElement = new CspDirectiveBaseConfigurationElement();
 }
Пример #4
0
 public CspDirectiveBaseConfigurationElementValidatorTests()
 {
     _validator     = new CspDirectiveBaseConfigurationElementValidator();
     _configElement = new CspDirectiveBaseConfigurationElement <CspSourceConfigurationElement>();
 }