public void T10_RecordKeyEncodeDecodeBugTest()
{
// test encode/decode with byte[] parts
// 92 43 0
byte[] chars = { 92, 43, 0 };
{
System.Text.ASCIIEncoding enc = new System.Text.ASCIIEncoding();
String keystring = enc.GetString(chars);
enc.GetBytes(keystring);
Assert.AreEqual(chars, enc.GetBytes(keystring), "string encoding not reversible");
RecordKey key = new RecordKey();
key.appendKeyPart(chars);
byte[] data = key.encode();
Assert.AreEqual(key, new RecordKey(data), "check encode/decode with binary data");
// check nested key
var wrap_key = new RecordKey().appendKeyPart(key.encode());
byte[] wrap_encoded = wrap_key.encode();
RecordKey wrap_decoded = new RecordKey(wrap_encoded);
}
}