public void TestMethod41() { ResetTestState(); Console.WriteLine(MethodBase.GetCurrentMethod().Name); var v1 = new CDicInheriteWithField(); v1.Init1(); Console.WriteLine("Key1:"); IKey key = IKeyFactory.CreateKey("RootKey"); _serializer.Serialize(v1, key, this); string text = key.SaveToString(); Console.WriteLine(text); int mem_sz = key.GetMemorySize(); byte[] array = new byte[mem_sz]; key.BinarySerialize(array, 0); Console.WriteLine($"Array Size: {array.Length} bytes"); Console.WriteLine("Key2:"); IKey key2 = IKeyFactory.CreateKey(array, 0); text = key2.SaveToString(); Console.WriteLine(text); var v2 = _serializer.Deserialize <CDicInheriteWithField>(key2, this); CheckInternalErrors(); Assert.AreEqual(v1, v2); }
public void TestMethodDicInheriteWithFieldOneRec() { ResetTestState(); Console.WriteLine(MethodBase.GetCurrentMethod().Name); var v1 = new CDicInheriteWithField(); v1.Init1(); string text = _serializer.SerializeToCascade(v1, this); Console.WriteLine(text); var v2 = _serializer.Deserialize <CDicInheriteWithField>(text, this); CheckInternalErrors(); Assert.AreEqual(v1, v2); }