public void TestDeSerNullItem() { BrokenDeserEntity obj = new BrokenDeserEntity { Value = 12345 }; using (MemoryStream ms = new MemoryStream()) { BinaryFormatter bf = new BinaryFormatter(); bf.Serialize(ms, obj); ms.Position = 0; try { BrokenDeserEntity clone = (BrokenDeserEntity)bf.Deserialize(ms); } catch (TargetInvocationException ex) { if (ex.InnerException == null) { throw; } throw ex.InnerException; } } }
public void TestDeSerNullItem() { BrokenDeserEntity obj = new BrokenDeserEntity { Value = 12345 }; using (MemoryStream ms = new MemoryStream()) { BinaryFormatter bf = new BinaryFormatter(); bf.Serialize(ms, obj); ms.Position = 0; try { BrokenDeserEntity clone = (BrokenDeserEntity)bf.Deserialize(ms); } catch (TargetInvocationException ex) { if (ex.InnerException == null) throw; throw ex.InnerException; } } }