Пример #1
0
        public void RDN_Getter_Escaped_Parse()
        {
            Entry target = new Entry(@"uid=lunchbox\, joe,ou=users,dc=test,dc=com");

            string expected = @"uid=lunchbox\, joe";
            string actual = target.RDN;

            Assert.AreEqual(expected, actual);
            Assert.IsFalse(target.IsDnDirty);
        }
Пример #2
0
        public void RDN_Getter_Simple_Parse()
        {
            
            Entry target = new Entry(@"uid=jblow,ou=users,dc=test,dc=com");

            string expected = @"uid=jblow";
            string actual = target.RDN;

            Assert.AreEqual(expected, actual);
            Assert.IsFalse(target.IsDnDirty);
        }
Пример #3
0
        public void Entry_Indexer_BasicTest()
        {
            Entry target = new Entry(@"uid=jblow,ou=users,dc=test,dc=com");
            target["test"] = new Attr("test", new[] { "value" });

            string expected = @"value";
            string actual = (string) target["TEST"].Value[0];

            foreach (var a in target)
            {
                System.Console.WriteLine("Attribute {0} in enumerator", a.Name);
            }

            Assert.AreEqual(expected, actual);
            Assert.IsFalse(target.IsDnDirty);
        }
Пример #4
0
        public void SuperiorDnTest()
        {
            Entry t = new Entry("uid=joe,ou=users,dc=test,dc=com");
            t.SuperiorDn = "ou=superusers,dc=test,dc=com";

            string expected = "ou=superusers,dc=test,dc=com";
            string actual = t.SuperiorDn;

            Assert.AreEqual(expected, actual);
            Assert.IsTrue(t.IsDnDirty);
            Assert.IsTrue(t.IsSuperiorDirty);
        }
Пример #5
0
        public void RDN_Setter_Escaped_Parse()
        {

            Entry target = new Entry(@"uid=lunchbox\, joe,ou=users,dc=test,dc=com");
            target.RDN = "uid=joe";

            string expected = @"uid=joe,ou=users,dc=test,dc=com";
            string actual = target.DistinguishedName;

            Assert.AreEqual(expected, actual);
            Assert.IsTrue(target.IsDnDirty);
        }
Пример #6
0
 void _ldif_OnBeginEntry(object sender, DnEventArgs e)
 {
     _complete = false;
     _work = new Entry(e.DistinguishedName);
 }