Пример #1
0
 public void ArraySerializationTest()
 {
     using (var app = new DextopTestApplication())
     {
         var arraySerializer = new DextopModelArraySerializer(app.ModelManager.GetModelMeta(typeof(Model)));
         var data = arraySerializer.Serialize(new[] { new Model { Id = 1, Name = "Name", Bool = true } });
         Assert.AreEqual("[[1,\"Name\",true]]", JsonUtil.Encode(data));
     }
 }
Пример #2
0
 void ArraySerializationTest(int n)
 {
     using (var app = new DextopTestApplication())
     {
         var arraySerializer = new DextopModelArraySerializer(app.ModelManager.GetModelMeta(typeof(Model)));
         var list = new List<object>();
         for (var i = 0; i<n; i++)
             list.Add(new Model { Id = 1, Name = "Name", Bool = true });
         var data = arraySerializer.Serialize(list);
         var str = DextopUtil.Encode(data);
     }
 }