Ejemplo n.º 1
0
        public void TestDeSerNullContext()
        {
            RemotingEntity obj = new RemotingEntity {
                Value = 12345
            };

            Serializer.Merge((SerializationInfo)null, obj);
        }
Ejemplo n.º 2
0
        public void TestClone()
        {
            using (MemoryStream ms = new MemoryStream())
            {
                RemotingEntity obj = new RemotingEntity {Value = 12345};
                Assert.IsFalse(obj.WasDeserialized);
                Assert.IsFalse(obj.WasSerialized);
                BinaryFormatter bf = new BinaryFormatter();
                bf.Serialize(ms, obj);
                Assert.IsTrue(obj.WasSerialized);
                ms.Position = 0;
                RemotingEntity clone = (RemotingEntity) bf.Deserialize(ms);
                Assert.IsFalse(clone.WasSerialized);
                Assert.IsTrue(clone.WasDeserialized);
                Assert.AreEqual(obj.Value, clone.Value);

            }
        }
Ejemplo n.º 3
0
 public void TestClone()
 {
     using (MemoryStream ms = new MemoryStream())
     {
         RemotingEntity obj = new RemotingEntity {
             Value = 12345
         };
         Assert.IsFalse(obj.WasDeserialized);
         Assert.IsFalse(obj.WasSerialized);
         BinaryFormatter bf = new BinaryFormatter();
         bf.Serialize(ms, obj);
         Assert.IsTrue(obj.WasSerialized);
         ms.Position = 0;
         RemotingEntity clone = (RemotingEntity)bf.Deserialize(ms);
         Assert.IsFalse(clone.WasSerialized);
         Assert.IsTrue(clone.WasDeserialized);
         Assert.AreEqual(obj.Value, clone.Value);
     }
 }
Ejemplo n.º 4
0
 public void TestSerNullContext()
 {
     RemotingEntity obj = new RemotingEntity {Value = 12345};
     Serializer.Serialize((SerializationInfo)null, obj);
 }