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); }
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()); }