public void TypeNameIntList()
        {
            TypeNameList <int> l = new TypeNameList <int>();

            l.Add(1);
            l.Add(2);
            l.Add(3);

            string json = JsonConvert.SerializeObject(l, Formatting.Indented);

            Assert.AreEqual(@"[
  1,
  2,
  3
]", json);
        }
        public void TypeNameComponentList()
        {
            var c1 = new TestComponentSimple();

            TypeNameList <object> l = new TypeNameList <object>();

            l.Add(c1);
            l.Add(new Employee
            {
                BirthDate  = new DateTime(2000, 12, 12, 12, 12, 12, DateTimeKind.Utc),
                Department = "Department!"
            });
            l.Add("String!");
            l.Add(long.MaxValue);

            string json = JsonConvert.SerializeObject(l, Formatting.Indented);

            Assert.AreEqual(@"[
  {
    ""$type"": ""Newtonsoft.Json.Tests.Serialization.TestComponentSimple, Newtonsoft.Json.Tests"",
    ""MyProperty"": 0
  },
  {
    ""$type"": ""Newtonsoft.Json.Tests.TestObjects.Employee, Newtonsoft.Json.Tests"",
    ""FirstName"": null,
    ""LastName"": null,
    ""BirthDate"": ""2000-12-12T12:12:12Z"",
    ""Department"": ""Department!"",
    ""JobTitle"": null
  },
  ""String!"",
  9223372036854775807
]", json);

            TypeNameList <object> l2 = JsonConvert.DeserializeObject <TypeNameList <object> >(json);

            Assert.AreEqual(4, l2.Count);

            CustomAssert.IsInstanceOfType(typeof(TestComponentSimple), l2[0]);
            CustomAssert.IsInstanceOfType(typeof(Employee), l2[1]);
            CustomAssert.IsInstanceOfType(typeof(string), l2[2]);
            CustomAssert.IsInstanceOfType(typeof(long), l2[3]);
        }