Ejemplo n.º 1
0
        public void Set_Get_Json()
        {
            //string key = "get_set_json";
            UserBase1 user = new UserBase1();

            user.Country = "cn";
            user.Name    = "john";
            user.City    = "wx";

            //ProtobufList<UserBase1> proList = new ProtobufList<UserBase1>();
            //proList.Add()

            ProtobufKey k = new ProtobufKey("ss");//还必须加上key的名字啊

            k.Set(user);
            UserBase1 us = k.Get <UserBase1>();

            Assert.AreEqual("john", us.Name);
        }
Ejemplo n.º 2
0
        public void Set_Get_Json()
        {
            //string key = "get_set_json";
            UserBase1 user = new UserBase1();
            user.Country = "cn";
            user.Name = "john";
            user.City = "wx";

            //ProtobufList<UserBase1> proList = new ProtobufList<UserBase1>();
            //proList.Add()

            ProtobufKey k = new ProtobufKey("ss");//还必须加上key的名字啊
            k.Set(user);
            UserBase1 us = k.Get<UserBase1>();
            Assert.AreEqual("john", us.Name);
        }