Ejemplo n.º 1
0
        public void None_SetsNoneSrc()
        {
            var directive = new CspDirective();

            directive.None();

            Assert.True(directive.NoneSrc);
        }
        public void None_SetsNoneSrc()
        {
            var directive = new CspDirective();

            directive.None();
            
            Assert.IsTrue(directive.NoneSrc);
        }
Ejemplo n.º 3
0
        public void None_DirectiveSourcesConfigured_ThrowsException()
        {
            var directiveSelf         = new CspDirective();
            var directiveSources      = new CspDirective();
            var directiveUnsafeInline = new CspDirective();
            var directiveUnsafeEval   = new CspDirective();

            directiveSelf.Self();
            directiveSources.CustomSources("https:");
            directiveUnsafeInline.UnsafeInline();
            directiveUnsafeEval.UnsafeEval();

            Assert.Throws <InvalidOperationException>(() => directiveSelf.None());
            Assert.Throws <InvalidOperationException>(() => directiveSources.None());
            Assert.Throws <InvalidOperationException>(() => directiveUnsafeInline.None());
            Assert.Throws <InvalidOperationException>(() => directiveUnsafeEval.None());
        }