Example #1
0
        public void EqualityCreatesCorrectSearchFilter()
        {
            // Fixture setup

            // Exercise system
            var filter = SearchFilter.Equality("displayName", "John Doe");

            // Verify outcome
            filter.ToString().Should().Be("(displayName=John Doe)");
        }
Example #2
0
        public void AndCreatesCorrectSearchFilter()
        {
            // Fixture setup

            // Exercise system
            var filter = SearchFilter
                         .Equality("displayName", "John")
                         .And(SearchFilter.Presence("mail"))
                         .And(SearchFilter.Negation("sn", "Doe"));

            // Verify outcome
            filter.ToString().Should().Be("(&(displayName=John)(mail=*)(!(sn=Doe)))");
        }
Example #3
0
 public void Foo()
 {
     var filter   = SearchFilter.Equality(DirectoryProperty.SamAccountName.ToString(), "16696763");
     var provider = new DirectoryProvider();
     var user     = provider.FindOne(AdsPath.Parse("LDAP://DC=sigma,DC=sbrf,DC=ru"), filter);
 }