public void TestParseLdapHostName() { LdapUri uri; Assert.IsTrue(LdapUri.TryParse("ldap://ldap.itd.umich.edu", out uri)); Assert.AreEqual("ldap", uri.Scheme, "Scheme"); Assert.AreEqual("ldap.itd.umich.edu", uri.Host, "Host"); Assert.AreEqual(0, uri.Port, "Port"); Assert.AreEqual(string.Empty, uri.DistinguishedName, "DistinguishedName"); Assert.AreEqual("*", uri.Attributes[0], "Attributes"); Assert.AreEqual(SearchScope.Base, uri.Scope, "Scope"); Assert.AreEqual("(objectClass=*)", uri.Filter, "Filter"); Assert.AreEqual(null, uri.Extensions, "Extensions"); }
public void TestParseRfc2255Example7() { LdapUri uri; Assert.IsTrue(LdapUri.TryParse("ldap://ldap.netscape.com/o=Babsco,c=US??(int=%5c00%5c00%5c00%5c04)", out uri)); Assert.AreEqual("ldap", uri.Scheme, "Scheme"); Assert.AreEqual("ldap.netscape.com", uri.Host, "Host"); Assert.AreEqual(0, uri.Port, "Port"); Assert.AreEqual("o=Babsco,c=US", uri.DistinguishedName, "DistinguishedName"); Assert.AreEqual("*", uri.Attributes[0], "Attributes"); Assert.AreEqual(SearchScope.Base, uri.Scope, "Scope"); Assert.AreEqual("(int=\\00\\00\\00\\04)", uri.Filter, "Filter"); Assert.AreEqual(null, uri.Extensions, "Extensions"); }
public void TestParseRfc2255Example9() { LdapUri uri; Assert.IsTrue(LdapUri.TryParse("ldap:///??sub??!bindname=cn=Manager%2co=Foo", out uri)); Assert.AreEqual("ldap", uri.Scheme, "Scheme"); Assert.AreEqual(string.Empty, uri.Host, "Host"); Assert.AreEqual(0, uri.Port, "Port"); Assert.AreEqual(string.Empty, uri.DistinguishedName, "DistinguishedName"); Assert.AreEqual("*", uri.Attributes[0], "Attributes"); Assert.AreEqual(SearchScope.Subtree, uri.Scope, "Scope"); Assert.AreEqual("(objectClass=*)", uri.Filter, "Filter"); Assert.AreEqual("!bindname=cn=Manager,o=Foo", uri.Extensions[0], "Extensions"); }
public void TestParseRfc2255Example6() { LdapUri uri; Assert.IsTrue(LdapUri.TryParse("ldap://ldap.question.com/o=Question%3f,c=US?mail", out uri)); Assert.AreEqual("ldap", uri.Scheme, "Scheme"); Assert.AreEqual("ldap.question.com", uri.Host, "Host"); Assert.AreEqual(0, uri.Port, "Port"); Assert.AreEqual("o=Question?,c=US", uri.DistinguishedName, "DistinguishedName"); Assert.AreEqual("mail", uri.Attributes[0], "Attributes"); Assert.AreEqual(SearchScope.Base, uri.Scope, "Scope"); Assert.AreEqual("(objectClass=*)", uri.Filter, "Filter"); Assert.AreEqual(null, uri.Extensions, "Extensions"); }
public void TestParseRfc2255Example5() { LdapUri uri; Assert.IsTrue(LdapUri.TryParse("ldap://ldap.itd.umich.edu/c=GB?objectClass?one", out uri)); Assert.AreEqual("ldap", uri.Scheme, "Scheme"); Assert.AreEqual("ldap.itd.umich.edu", uri.Host, "Host"); Assert.AreEqual(0, uri.Port, "Port"); Assert.AreEqual("c=GB", uri.DistinguishedName, "DistinguishedName"); Assert.AreEqual("objectClass", uri.Attributes[0], "Attributes"); Assert.AreEqual(SearchScope.OneLevel, uri.Scope, "Scope"); Assert.AreEqual("(objectClass=*)", uri.Filter, "Filter"); Assert.AreEqual(null, uri.Extensions, "Extensions"); }
public void TestParseRfc2255Example4() { LdapUri uri; Assert.IsTrue(LdapUri.TryParse("ldap://host.com:6666/o=University%20of%20Michigan,c=US??sub?(cn=Babs%20Jensen)", out uri)); Assert.AreEqual("ldap", uri.Scheme, "Scheme"); Assert.AreEqual("host.com", uri.Host, "Host"); Assert.AreEqual(6666, uri.Port, "Port"); Assert.AreEqual("o=University of Michigan,c=US", uri.DistinguishedName, "DistinguishedName"); Assert.AreEqual("*", uri.Attributes[0], "Attributes"); Assert.AreEqual(SearchScope.Subtree, uri.Scope, "Scope"); Assert.AreEqual("(cn=Babs Jensen)", uri.Filter, "Filter"); Assert.AreEqual(null, uri.Extensions, "Extensions"); }
public void TestParseRfc2255Example3() { LdapUri uri; Assert.IsTrue(LdapUri.TryParse("ldap://ldap.itd.umich.edu/o=University%20of%20Michigan,c=US?postalAddress", out uri)); Assert.AreEqual("ldap", uri.Scheme, "Scheme"); Assert.AreEqual("ldap.itd.umich.edu", uri.Host, "Host"); Assert.AreEqual(0, uri.Port, "Port"); Assert.AreEqual("o=University of Michigan,c=US", uri.DistinguishedName, "DistinguishedName"); Assert.AreEqual("postalAddress", uri.Attributes[0], "Attributes"); Assert.AreEqual(SearchScope.Base, uri.Scope, "Scope"); Assert.AreEqual("(objectClass=*)", uri.Filter, "Filter"); Assert.AreEqual(null, uri.Extensions, "Extensions"); }
public void TestParseLdapHostNameColon() { LdapUri uri; Assert.IsFalse(LdapUri.TryParse("ldap://ldap.itd.umich.edu:", out uri)); }
public void TestParseLdapColonSlash() { LdapUri uri; Assert.IsFalse(LdapUri.TryParse("ldap:/", out uri)); }
public void TestParseEmptyString() { LdapUri uri; Assert.IsFalse(LdapUri.TryParse("", out uri)); }
public void TestParseLdapInvalidPort2() { LdapUri uri; Assert.IsFalse(LdapUri.TryParse("ldap://ldap.itd.umich.edu:65537", out uri)); }