public void Cannot_Serialize_If_Not_A_DataContract()
{
var ser = new JsonSerializer();
var str = new MemoryStream();
try
{
ser.Serialize(str, new object());
Assert.Fail("Should have thrown an exception.");
}
catch (ArgumentException e)
{
Assert.AreEqual("System.Object is not a DataContract, cannot serialize to JSON.", e.Message);
}
}