Skip to content

Instantly share code, notes, and snippets.

@samueleresca
Created December 3, 2015 20:08
Show Gist options
  • Save samueleresca/57e26875745babe5f213 to your computer and use it in GitHub Desktop.
Save samueleresca/57e26875745babe5f213 to your computer and use it in GitHub Desktop.
[TestClass]
public class ConditionalSerializingTests
{
public Telefilm[] Telefilms = new Telefilm[]{
new Telefilm{TelefilmId=1 , TelefilmName="Slevin" , CreateDate= new DateTime(1999,04,23)},
new Telefilm{TelefilmId=2 , TelefilmName="Scrubs" , CreateDate= new DateTime(2001,02,08) },
new Telefilm{TelefilmId=3 , TelefilmName="HIMYM" , CreateDate= new DateTime(2004,12,05)},
new Telefilm{TelefilmId=4 , TelefilmName="Californication", CreateDate= new DateTime(2010,02,12)}
};
[TestMethod]
public void SerializeTelefilms()
{
string serializedObj = JsonConvert.SerializeObject(this.Telefilms, Formatting.Indented);
serializedObj.ToString();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment