public void SerializeUnsafeObjectFails() { var self = new NonSerializableObject(); self.AString = "test"; self.AnInt = 12; string actual = null; try { actual = self.Serialize("http://unsafe.com/"); Assert.Fail(); } catch { Assert.AreEqual(null, actual); } }
public void SerializeUnsafeObjectSuccess() { var self = new NonSerializableObject(); self.AString = "test"; self.AnInt = 12; var actual = self.Serialize("http://unsafe.com/", true); Assert.IsTrue(actual.Contains("test")); Assert.IsTrue(actual.Contains("http://unsafe.com/")); }