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); }
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); }
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); }
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); }
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); }
void _ldif_OnBeginEntry(object sender, DnEventArgs e) { _complete = false; _work = new Entry(e.DistinguishedName); }