Пример #1
0
        public void SerializeV2()
        {
            MonsterCollectionState0 monsterCollectionState = new MonsterCollectionState0(_address, 1, 10000);
            Dictionary serialized = (Dictionary)monsterCollectionState.SerializeV2();

            Assert.Equal(serialized, new MonsterCollectionState0(serialized).SerializeV2());
        }
Пример #2
0
        public void SerializeV2_DotNet_API()
        {
            MonsterCollectionState0 monsterCollectionState = new MonsterCollectionState0(_address, 1, 10000);
            var formatter = new BinaryFormatter();

            using var ms = new MemoryStream();
            formatter.Serialize(ms, monsterCollectionState);
            ms.Seek(0, SeekOrigin.Begin);

            var deserialized = (MonsterCollectionState0)formatter.Deserialize(ms);

            Assert.Equal(monsterCollectionState.SerializeV2(), deserialized.SerializeV2());
        }