public void ConvertsToString() { Directives dirs = new Directives(); for (int idx = 0; idx < 10; ++idx) { dirs.Add("HELLO"); } var xml = dirs.ToString(); Assert.True( new Regex("ADD \"HELLO\";").Matches(xml).Count == 10 ); }
public ContentSecurityPolicyMiddleware(IHostEnvironment environment, CspDirectiveList directives) { Directives = directives ?? throw new ArgumentNullException(nameof(directives)); _headerValue = Directives.ToString(); _isDevelopment = environment.IsDevelopment(); }
public XRobotsTagMiddleware(RobotsTagDirectiveList headerValue) { Directives = headerValue ?? throw new ArgumentNullException(nameof(headerValue)); _headerValue = Directives.ToString(); }