public void ShouldThrowForbidenExceptionIfUserAgentMatchesItemInBannedAgentsList() { List<string> bannedAgents = new List<string>(); bannedAgents.Add("bingbot"); string botUserAgent = "HTTP/1.1 Mozilla/5.0+(compatible;+bingbot/2.0;++http://www.bing.com/bingbot.htm)"; DnaBasePage basePage = new DnaBasePage(null); basePage.CheckForForbiddenUserAgents(botUserAgent, bannedAgents); }
public void ShouldThrowForbidenExceptionIfUserAgentMatchesItemInBannedAgentsList() { List<string> bannedAgents = new List<string>(); bannedAgents.Add("bingbot"); string botUserAgent = "HTTP/1.1 Mozilla/5.0+(compatible;+bingbot/2.0;++http://www.bing.com/bingbot.htm)"; DnaBasePage basePage = new DnaBasePage(null); BBC.Dna.Utils.Statistics.InitialiseIfEmpty(null,false); Assert.IsTrue(basePage.CheckForForbiddenUserAgents(botUserAgent, bannedAgents)); }