Ejemplo n.º 1
0
 public void DistinguishedName_SpaceDot()
 {
     string dnStr = @"CN=John,OU=Employees,O=adatum Inc.,C=US";
     var dn = new DistinguishedName(dnStr);
     Assert.AreEqual(dn.ToString(), dnStr);
     Assert.AreEqual(4, dn.Components.Count);
 }
Ejemplo n.º 2
0
 public void DistinguishedName_HexEncodedBinaryValueEnd()
 {
     var dn = new DistinguishedName("CN=John,OU=Employees,DC=adatum,DC=#324312af34e4");
     Assert.AreEqual(dn.ToString(), "CN=John,OU=Employees,DC=adatum,DC=#324312af34e4");
 }
Ejemplo n.º 3
0
 public void DistinguishedName_HexEncodedBinaryValueMiddle()
 {
     var dn = new DistinguishedName("CN=John,OU=#324312af34e4,DC=adatum,DC=com");
     Assert.AreEqual(dn.ToString(), "CN=John,OU=#324312af34e4,DC=adatum,DC=com");
 }
Ejemplo n.º 4
0
 public void DistinguishedName_HexEncodedBinaryValueSingle()
 {
     var dn = new DistinguishedName("CN=#324312af34e4");
     Assert.AreEqual(dn.ToString(), "CN=#324312af34e4");
 }
Ejemplo n.º 5
0
 public void DistinguishedName_Empty()
 {
     var dn = new DistinguishedName(String.Empty);
     Assert.AreEqual(dn.ToString(), String.Empty);
 }
Ejemplo n.º 6
0
 public void DistinguishedName_LongSpaces()
 {
     var dn = new DistinguishedName(@"    CN     =    John  , OU =  Employees,DC   =    adatum,DC = com");
     Assert.AreEqual(dn.ToString(), "CN=John,OU=Employees,DC=adatum,DC=com");
 }
Ejemplo n.º 7
0
 public void DistinguishedName_EscapedComma()
 {
     string dnStr = @"CN=Doe\, John,OU=Employees,DC=adatum,DC=com";
     var dn = new DistinguishedName(dnStr);
     Assert.AreEqual( dnStr, dn.ToString());
 }
Ejemplo n.º 8
0
 public void DistinguishedName_QuotesEnd()
 {
     var dn = new DistinguishedName(@"OU=John,OU=is,OU=""cool""");
     Assert.AreEqual(dn.ToString(), "OU=John,OU=is,OU=cool");
 }
Ejemplo n.º 9
0
 public void DistinguishedName_EscapedSpecialChars()
 {
     var dn = new DistinguishedName(@"OU=""\,\=\+\<\>\#\;\\\ """);
     Assert.AreEqual(dn.ToString(), @"OU=\,\=\+\<\>\#\;\\\ ");
 }
Ejemplo n.º 10
0
 public void DistinguishedName_QuotesSingle()
 {
     var dn = new DistinguishedName(@"OU=""John is cool""");
     Assert.AreEqual(dn.ToString(), "OU=John is cool");
 }
Ejemplo n.º 11
0
 public void DistinguishedName_OIDs()
 {
     string dnStr1 = @"OID.3.43.128=John";
     string dnStr2 = @"3.43.128=John";
     var dn1 = new DistinguishedName(dnStr1);
     var dn2 = new DistinguishedName(dnStr2);
     Assert.AreEqual(dn1.ToString(), dnStr1);
     Assert.AreEqual(dn1.Components.Count, 1);
     Assert.AreEqual(dn2.ToString(), dnStr2);
     Assert.AreEqual(dn2.Components.Count, 1);
 }
Ejemplo n.º 12
0
 public void DistinguishedName_HexEscapeNonSpecialCharacter()
 {
     var dn = new DistinguishedName(@"CN=John\20Doe,OU=Employees,DC=adatum,DC=com");
     Assert.AreEqual(dn.ToString(), @"CN=John Doe,OU=Employees,DC=adatum,DC=com");
 }
Ejemplo n.º 13
0
 public void DistinguishedName_SpacesAtBeginningAndEnd()
 {
     var dn = new DistinguishedName(@"CN=\     John    \ ");
     Assert.AreEqual(dn.ToString(), @"CN=\     John    \ ");
 }
Ejemplo n.º 14
0
 public void DistinguishedName_DCNaming()
 {
     string dnStr = @"CN=John,OU=Employees,DC=adatum,DC=com";
     var dn = new DistinguishedName(dnStr);
     Assert.AreEqual(dn.ToString(), dnStr);
 }