public void AndRequestCondition_ShouldProcess_ReturnsTrueIfAllChildConditionsPass() { var condition1 = new AuthorityRequestCondition(); condition1.AddAuthority("sometestsite"); var condition2 = new RequestContentMediaTypeCondition(); condition2.AddContentMediaType(MediaTypes.TextPlain); var andCondition = new AndRequestCondition(new IRequestCondition[] { condition1, condition2 }); var testRequest = new System.Net.Http.HttpRequestMessage(System.Net.Http.HttpMethod.Post, "http://sometestsite/testendpoint"); testRequest.Content = new System.Net.Http.StringContent("AAAABBBBCCCCDDD", System.Text.UTF8Encoding.UTF8, MediaTypes.TextPlain); Assert.IsTrue(andCondition.ShouldProcess(testRequest)); }
public void AuthorityRequestCondition_ShouldProcess_ReturnsFalseForUnsupportedAuthority() { var authorityCondition = new AuthorityRequestCondition(new string[] { "www.microsoft.com", "www.google.com" }); Assert.IsFalse(authorityCondition.ShouldProcess(new System.Net.Http.HttpRequestMessage(System.Net.Http.HttpMethod.Get, "http://www.yahoo.com/"))); }
public void AuthorityRequestCondition_Constructor_ConstructsWithMultipleAuthorities() { var authorityCondition = new AuthorityRequestCondition(new string[] { "www.microsoft.com", "www.google.com" }); }
public void AuthorityRequestCondition_Constructor_ConstructsWithSingleAuthority() { var authorityCondition = new AuthorityRequestCondition(new string[] { "www.microsoft.com" }); }
public void AuthorityRequestCondition_Constructor_ConstructsWithEmptyList() { var authorityCondition = new AuthorityRequestCondition(new string[] { }); }
public void AuthorityRequestCondition_Constructor_ConstructsWithDefaultConstuctor() { var authorityCondition = new AuthorityRequestCondition(); }
public void AuthorityRequestCondition_Constructor_AllowsNullAuthorityList() { var authorityCondition = new AuthorityRequestCondition(null); }