public void MapSetdRemove() { JsonMapSet map = "HENRY_INFO"; UserBase ub = new UserBase(); ub.Name = "henryfan"; ub.City = "gz"; ub.Counrty = "cn"; ub.Age = 10; Contact contact = new Contact(); contact.EMail = "*****@*****.**"; contact.QQ = "28304340"; contact.Phone = "13660223497"; map.Set(ub, contact); map.Remove <Contact>(); contact = map.Get <Contact>(); Assert.AreEqual(null, contact); }
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); }
public void MapSet() { JsonMapSet map = "HENRY_INFO"; UserBase ub = new UserBase(); ub.Name = "henryfan"; ub.City = "gz"; ub.Counrty = "cn"; ub.Age = 10; Contact contact = new Contact(); contact.EMail = "*****@*****.**"; contact.QQ = "28304340"; contact.Phone = "13660223497"; map.Set(ub, contact); IList <object> data = map.Get <UserBase, Contact>(); Assert.AreEqual(ub.Name, ((UserBase)data[0]).Name); Assert.AreEqual(contact.Phone, ((Contact)data[1]).Phone); }
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); }
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]); }