public void LST_Region() { ProtobufList <UserBase> lst = "USERS"; lst.Clear(); for (int i = 0; i < 10; i++) { lst.Add(new UserBase { Name = "henry" + i, Age = 18, City = "gz", Counrty = "cn" }); } IList <UserBase> items = lst.Range(); Assert.AreEqual(items[0].Name, "henry0"); Assert.AreEqual(items[9].Name, "henry9"); items = lst.Range(5, 7); Assert.AreEqual(items[0].Name, "henry5"); Assert.AreEqual(items[2].Name, "henry7"); }
public void LST_Region() { ProtobufList <UserBase1> lst = "USERS"; lst.Clear(); for (int i = 0; i < 10; i++) { lst.Add(new UserBase1 { Name = "john" + i, Age = 19, City = "wx", Country = "zc" }); } IList <UserBase1> items = lst.Range(); Assert.AreEqual(items[0].Name, "john0"); Assert.AreEqual(items[9].Name, "john9"); items = lst.Range(5, 7); Assert.AreEqual(items[0].Name, "john5"); Assert.AreEqual(items[2].Name, "john7"); }