public void TestReadLdapMissingAttribute() { var filter = new ReadLdapFilter(); var attrib = new AttributeElement { Name = "NotFound" }; // mock the ldap search result var result = SearchResultFactory.Construct(new { givenName = "Thomas" }); var value = filter.Execute(null, result, null, attrib); Assert.IsNull(value); }
public void TestReadLdapValue() { var filter = new ReadLdapFilter(); var attrib = new AttributeElement { Name = "givenName" }; // mock the ldap search result var result = SearchResultFactory.Construct(new { givenName = "Thomas" }); var value = filter.Execute(null, result, null, attrib); Assert.AreEqual(value, "Thomas"); }