public void DefaultValue_ReturnsSelf() { var builder = new ContentSecurityPolicyBuilder(); Assert.Single(builder.Default); Assert.Equal("'self'", builder.Default.First()); }
public void DefaultValue_Empty() { var builder = new ContentSecurityPolicyBuilder(); Assert.Single(builder.Object); Assert.Equal("'none'", builder.Object.First()); }
private static ContentSecurityPolicyBuilder Builder(bool clear = true) { var builder = new ContentSecurityPolicyBuilder(); if (clear) { builder.Default.Clear(); builder.Object.Clear(); } return(builder); }
public void WhenCalled_SetsContentSecurityPolicy() { var options = Options(); var csp = new ContentSecurityPolicyBuilder(); csp.Default.Clear(); csp.Object.Clear(); csp.Default.Add("https://example.com"); options.Configure(csp); Assert.Equal(csp.ToString(), options.ContentSecurityPolicy); }
public void DefaultValue_Empty() { var builder = new ContentSecurityPolicyBuilder(); Assert.Empty(builder.Manifest); }
public void DefaultValue_ReturnsValue() { var value = new ContentSecurityPolicyBuilder().ToString(); Assert.Equal("default-src 'self'; object-src 'none'", value); }
public void DefaultValue_Empty() { var builder = new ContentSecurityPolicyBuilder(); Assert.Empty(builder.StyleAttr); }
public void DefaultValue_Empty() { var builder = new ContentSecurityPolicyBuilder(); Assert.Empty(builder.ScriptElem); }