public void SerializeWithCustom() { var serializer = new JsonSerializer { DateFormatString = "yyyy-yyyy-dd-M" }; var result = instance.SerializeArray(subscription, serializer); var text = Encoding.UTF8.GetString(result); var contains = text.Contains(DateTime.Today.ToString("yyyy-yyyy-dd-M")); Assert.IsTrue(contains); var backInstance = instance.Deserialize <DataInstance>(result, serializer); Assert.AreEqual(subscription.Date, backInstance.Date); }
public void SerializeArray() { var data = instance.SerializeArray(subscription); var result = instance.Deserialize <DataInstance>(data); Assert.AreEqual("Test", result.Text); }