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 = "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]); }
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 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 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]); }