예제 #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;
		}