func TestGetLDAPErrorSuccess(t *testing.T) {
	bindResponse := ber.Encode(ber.ClassApplication, ber.TypeConstructed, ApplicationBindResponse, nil, "Bind Response")
	bindResponse.AppendChild(ber.Encode(ber.ClassUniversal, ber.TypePrimitive, ber.TagInteger, int64(0), "resultCode"))
	bindResponse.AppendChild(ber.NewString(ber.ClassUniversal, ber.TypePrimitive, ber.TagOctetString, "", "matchedDN"))
	bindResponse.AppendChild(ber.NewString(ber.ClassUniversal, ber.TypePrimitive, ber.TagOctetString, "", "diagnosticMessage"))
	packet := ber.NewSequence("LDAPMessage")
	packet.AppendChild(ber.Encode(ber.ClassUniversal, ber.TypePrimitive, ber.TagInteger, int64(0), "messageID"))
	packet.AppendChild(bindResponse)
	err := GetLDAPError(packet)
	if err != nil {
		t.Errorf("Successful responses should not produce an error, but got: %v", err)
	}
}
// TestGetLDAPErrorSuccess tests parsing of a result with no error (resultCode == 0).
TestGetLDAPErrorSuccess tests parsing of a result with no error (resultCode == 0).
// TestGetLDAPErrorSuccess tests parsing of a result with no error ( resultCode == 0 ) .
func TestGetLDAPErrorSuccess(t *testing.T) {
	bindResponse := ber.Encode(ber.ClassApplication, ber.TypeConstructed, ApplicationBindResponse, nil, "Bind Response")
	bindResponse.AppendChild(ber.Encode(ber.ClassUniversal, ber.TypePrimitive, ber.TagInteger, int64(0), "resultCode"))
	bindResponse.AppendChild(ber.NewString(ber.ClassUniversal, ber.TypePrimitive, ber.TagOctetString, "", "matchedDN"))
	bindResponse.AppendChild(ber.NewString(ber.ClassUniversal, ber.TypePrimitive, ber.TagOctetString, "", "diagnosticMessage"))
	packet := ber.NewSequence("LDAPMessage")
	packet.AppendChild(ber.Encode(ber.ClassUniversal, ber.TypePrimitive, ber.TagInteger, int64(0), "messageID"))
	packet.AppendChild(bindResponse)
	err := GetLDAPError(packet)
	if err != nil {
		t.Errorf("Successful responses should not produce an error, but got: %v", err)
	}
}
func TestGetLDAPErrorSuccess ( t * testing . T ) { bindResponse := ber . Encode ( ber . ClassApplication , ber . TypeConstructed , ApplicationBindResponse , nil , " " ) bindResponse . AppendChild ( ber . Encode ( ber . ClassUniversal , ber . TypePrimitive , ber . TagInteger , int64 ( 0 ) , " " ) ) bindResponse . AppendChild ( ber . NewString ( ber . ClassUniversal , ber . TypePrimitive , ber . TagOctetString , " " , " " ) ) bindResponse . AppendChild ( ber . NewString ( ber . ClassUniversal , ber . TypePrimitive , ber . TagOctetString , " " , " " ) ) packet := ber . NewSequence ( " " ) packet . AppendChild ( ber . Encode ( ber . ClassUniversal , ber . TypePrimitive , ber . TagInteger , int64 ( 0 ) , " " ) ) packet . AppendChild ( bindResponse ) err := GetLDAPError ( packet ) if err != nil { t . Errorf ( " " , err ) } }
TestGetLDAPErrorSuccess tests parsing of a result with no error (resultCode == 0).
TestGetLDAPErrorSuccess tests parsing of a result with no error ( resultCode == 0 ) .