Exemple #1
0
        public void Constructs()
        {
            var props = new EntryAttributeDictionary(new Dictionary <string, Core.Proxies.AttributeValueList>());
            var path  = "something";
            var p     = new SearchResultProxy(null, props, path);

            Assert.Equal(path, p.Path);
            Assert.Equal(props, p.Properties);
        }
Exemple #2
0
        public void FindOne_ReturnsMappedFromBase()
        {
            var data = new SearchResultProxy()
            {
                Path       = "ou=some,com=path",
                Properties = new EntryAttributeDictionary()
            };

            Mock.Get(Searcher.Base)
            .Setup(m => m.FindOne())
            .Returns(data);
            var results = Searcher.FindOne();

            Mock.Get(Creator).Verify(m => m.Create <TestLdapModel>(data.Properties, data.Path), Times.Once);
        }
Exemple #3
0
        public void FindAll_ReturnsMappedFromBase()
        {
            var first = new SearchResultProxy()
            {
                Path       = "ou=some,com=path",
                Properties = new EntryAttributeDictionary()
            };
            var data = new SearchResultCollectionProxy(new List <SearchResultProxy>()
            {
                first
            });

            Mock.Get(Searcher.Base)
            .Setup(m => m.FindAll())
            .Returns(data);
            var results = Searcher.FindAll().ToList();

            Mock.Get(Creator).Verify(m => m.Create <TestLdapModel>(first.Properties, first.Path), Times.Once);
        }
Exemple #4
0
 public void ImplicitlyConverts()
 {
     SearchResult      sr = null;
     SearchResultProxy p  = sr;
 }