public void Publish()
 {
     MallCard mall = new MallCard()
     {
         ID = Guid.NewGuid().ToString("N").Substring(0, 5),
         Name = Guid.NewGuid().ToString("N"),
         MallID = new Random().Next(1, 100),
         UID = new Random().Next(1, 1000)
     };
     using (RedisCacheClient client = new RedisCacheClient(serializer))
     {
         client.Publish("var", mall);
     }
 }
        public void StringSet_StringGet()
        {
            MallCard mall = new MallCard()
            {
                ID = Guid.NewGuid().ToString("N").Substring(0, 5),
                Name = Guid.NewGuid().ToString("N"),
                MallID = new Random().Next(1, 100),
                UID = new Random().Next(1, 1000)
            };
            using (RedisCacheClient client = new RedisCacheClient(serializer))
            {
                var key = mall.GetKey();
                RedisValue val = serializer.Serialize(mall);
                client.Database.StringSet(key, val);
                client.Set(key, mall);

                //byte[] val2 = client.Database.StringGet(key);
                //var mall2 = serializer.Deserialize<MallCard2>(val2);
                var mall2 = client.Get<MallCard2>(key);

                Assert.AreEqual(mall.Name, mall2.Name);
            }
        }