示例#1
0
        public void TestSerializeAndDeserialize()
        {
            string            str_to_check = "Test String 1";
            RegularData       d            = new RegularData(Encoding.UTF8.GetBytes(str_to_check));
            FingerprintedData p            = new FingerprintedData(d);

            byte[] serializedObj = p.SerializeTo();
            Logger.WriteLineIf(LogLevel.Verbose, _log_props, Encoding.UTF8.GetString(serializedObj));
            FingerprintedData actual_p = (FingerprintedData)DictionaryData.CreateDictionaryData(serializedObj, new AdrSerializer());
            RegularData       actual_d = (RegularData)actual_p.InnerData;

            Assert.AreEqual(str_to_check, Encoding.UTF8.GetString(actual_d.PayLoad));
        }
示例#2
0
 public void TestSerializeAndDeserialize()
 {
     string str_to_check = "Test String 1";
       RegularData d = new RegularData(Encoding.UTF8.GetBytes(str_to_check));
       FingerprintedData p = new FingerprintedData(d);
       byte[] serializedObj = p.SerializeTo();
       Logger.WriteLineIf(LogLevel.Verbose, _log_props, Encoding.UTF8.GetString(serializedObj));
       FingerprintedData actual_p = (FingerprintedData)DictionaryData.CreateDictionaryData(serializedObj, new AdrSerializer());
       RegularData actual_d = (RegularData)actual_p.InnerData;
       Assert.AreEqual(str_to_check, Encoding.UTF8.GetString(actual_d.PayLoad));
 }