public RobotsBuilder ForUserAgent(string userAgent) { _lastUserAgent = new UserAgentEntry {UserAgent = userAgent}; _robots.AddEntry(_lastUserAgent); return this; }
public void CommentTest() { Entry target = new UserAgentEntry(); // TODO: Initialize to an appropriate value const string expected = "comment"; target.Comment = expected; string actual = target.Comment; Assert.Equal(expected, actual); }
public void Add_comment_Test() { var target = new UserAgentEntry(); Entry entry = new CommentEntry(); target.AddEntry(entry); Assert.NotEmpty(target.Entries); Assert.Empty(target.AllowEntries); Assert.Empty(target.DisallowEntries); }
public void AllowEntriesTest() { var target = new UserAgentEntry(); Assert.Empty(target.AllowEntries); }
public void EntryType_Test() { var target = new UserAgentEntry(); Assert.Equal(EntryType.UserAgent, target.Type); }
private bool CheckExplicitlyAllowed(UserAgentEntry userAgentEntry, Uri uri) { //if (!IsInternalToDomain(uri)) // return true; string[] uriParts = uri.PathAndQuery.Split(new[] {'/', '?'}, StringSplitOptions.RemoveEmptyEntries); foreach (var allowEntry in userAgentEntry.AllowEntries) { bool result; if (CheckAllowedEntry(allowEntry, uriParts, out result)) { return result; } } return false; }
public void HasCommentTest2() { Entry target = new UserAgentEntry {Comment = "comment"}; bool actual = target.HasComment; Assert.Equal(true, actual); }
public void HasCommentTest() { Entry target = new UserAgentEntry(); // TODO: Initialize to an appropriate value bool actual = target.HasComment; Assert.Equal(false, actual); }