public void TestMethod3() { ResetTestState(); Console.WriteLine(MethodBase.GetCurrentMethod().Name); var v1 = new CTestClassCollectionsAtom(); 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 <CTestClassCollectionsAtom>(key2, this); CheckInternalErrors(); Assert.AreEqual(v1, v2); }
public void TestMethodCollectionsAtom() { ResetTestState(); Console.WriteLine(MethodBase.GetCurrentMethod().Name); var v1 = new CTestClassCollectionsAtom(); v1.Init1(); string text = _serializer.SerializeToCascade(v1, this); Console.WriteLine(text); var v2 = _serializer.Deserialize <CTestClassCollectionsAtom>(text, this); CheckInternalErrors(); Assert.AreEqual(v1, v2); }