示例#1
0
        public void SerializationUnsafeRoundtrip()
        {
            Stream            s     = GetSerializedStream();
            BinaryFormatter   bf    = new BinaryFormatter();
            SerializationTest clone = (SerializationTest)bf.UnsafeDeserialize(s, null);

            Assert.AreEqual(Int32.MinValue, clone.Integer, "Integer");
            Assert.IsFalse(clone.Boolean, "Boolean");
        }
示例#2
0
        public Stream GetSerializedStream()
        {
            SerializationTest test = new SerializationTest(true, Int32.MinValue);
            BinaryFormatter   bf   = new BinaryFormatter();
            MemoryStream      ms   = new MemoryStream();

            bf.Serialize(ms, test);
            ms.Position = 0;
            return(ms);
        }
示例#3
0
		public Stream GetSerializedStream ()
		{
			SerializationTest test = new SerializationTest (true, Int32.MinValue);
			BinaryFormatter bf = new BinaryFormatter ();
			MemoryStream ms = new MemoryStream ();
			bf.Serialize (ms, test);
			ms.Position = 0;
			return ms;
		}