예제 #1
0
        public void MapSetdRemove()
        {
            JsonMapSet map = "john_info";
            UserBase   ub  = new UserBase();

            ub.Name    = "john";
            ub.City    = "wx";
            ub.Country = "cn";
            ub.Age     = 10;
            Contract contract = new Contract();

            contract.Email = "*****@*****.**";
            contract.QQ    = "23423";
            contract.Phone = "2322342";
            map.Set(ub, contract);
            map.Remove <Contract>();

            contract = map.Get <Contract>();
            Assert.AreEqual(null, contract);
        }
예제 #2
0
        public void MapSet()
        {
            JsonMapSet map = "john_info";
            UserBase   ub  = new UserBase();

            ub.Name    = "johnwonder";
            ub.City    = "wx";
            ub.Country = "cn";
            ub.Age     = 10;

            Contract contract = new Contract();

            contract.Email = "*****@*****.**";
            contract.QQ    = "230522";
            contract.Phone = "13353454";
            map.Set(ub, contract);
            IList <object> data = map.Get <UserBase, Contract>();

            Assert.AreEqual(ub.Name, ((UserBase)data[0]).Name);
            Assert.AreEqual(contract.Phone, ((Contract)data[1]).Phone);
        }
예제 #3
0
        public void MapSetClear()
        {
            JsonMapSet map = "John_info";
            UserBase   ub  = new UserBase();

            ub.Name    = "john";
            ub.Country = "cn";
            ub.City    = "wx";
            ub.Age     = 10;
            Contract contract = new Contract();

            contract.Phone = "345345345";
            contract.Email = "sjo@awd";
            contract.QQ    = "asdad";
            map.Set(ub, contract);
            map.Clear();

            IList <object> data = map.Get <UserBase, Contract>();

            Assert.AreEqual(null, data[0]);
            Assert.AreEqual(null, data[1]);
        }
예제 #4
0
        public void MapSet()
        {
            JsonMapSet map = "john_info";
            UserBase ub = new UserBase();
            ub.Name = "johnwonder";
            ub.City = "wx";
            ub.Country = "cn";
            ub.Age = 10;

            Contract contract = new Contract();
            contract.Email = "*****@*****.**";
            contract.QQ = "230522";
            contract.Phone = "13353454";
            map.Set(ub, contract);
            IList<object> data = map.Get<UserBase, Contract>();
            Assert.AreEqual(ub.Name, ((UserBase)data[0]).Name);
            Assert.AreEqual(contract.Phone, ((Contract)data[1]).Phone);
        }
예제 #5
0
        public void MapSetdRemove()
        {
            JsonMapSet map = "john_info";
            UserBase ub = new UserBase();
            ub.Name = "john";
            ub.City = "wx";
            ub.Country = "cn";
            ub.Age = 10;
            Contract contract = new Contract();
            contract.Email = "*****@*****.**";
            contract.QQ = "23423";
            contract.Phone = "2322342";
            map.Set(ub, contract);
            map.Remove<Contract>();

            contract = map.Get<Contract>();
            Assert.AreEqual(null, contract);
        }
예제 #6
0
        public void MapSetClear()
        {
            JsonMapSet map = "John_info";
            UserBase ub = new UserBase();
            ub.Name = "john";
            ub.Country = "cn";
            ub.City = "wx";
            ub.Age = 10;
            Contract contract = new Contract();
            contract.Phone = "345345345";
            contract.Email = "sjo@awd";
            contract.QQ = "asdad";
            map.Set(ub, contract);
            map.Clear();

            IList<object> data = map.Get<UserBase, Contract>();

            Assert.AreEqual(null, data[0]);
            Assert.AreEqual(null, data[1]);
        }