public void Execute(IPlatformFactory factory, ITestLogger logger) { string coordsys = "GEOGCS[\"LL84\",DATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563,AUTHORITY[\"EPSG\",\"7030\"]],TOWGS84[0,0,0,0,0,0,0],AUTHORITY[\"EPSG\",\"6326\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.0174532925199433,AUTHORITY[\"EPSG\",\"9108\"]],AXIS[\"Lat\",NORTH],AXIS[\"Long\",EAST],AUTHORITY[\"EPSG\",\"4326\"]]"; MgEnvelope env = new MgEnvelope(10, 10, 20, 20); MgMapBase map1 = factory.CreateMap(coordsys, env, "map1"); MgMapBase map2 = factory.CreateMap(coordsys, env, "map2"); MgMapBase map3 = factory.CreateMap(coordsys, env, "map3"); MgMapBase map4 = factory.CreateMap(coordsys, env, "map4"); MgMapCollection coll = new MgMapCollection(); coll.Add(map1); coll.Insert(1, map2); coll.Add(map3); Assert.AreEqual(3, coll.Count); Assert.AreEqual(coll[2].GetName(), "map3"); coll[1] = map4; string txt = ""; foreach (MgMapBase map in coll) { txt += "[" + map.GetName() + "]"; } Assert.AreEqual("[map1][map4][map3]", txt); }
public void MapCollection() { string coordsys = "GEOGCS[\"LL84\",DATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563,AUTHORITY[\"EPSG\",\"7030\"]],TOWGS84[0,0,0,0,0,0,0],AUTHORITY[\"EPSG\",\"6326\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.0174532925199433,AUTHORITY[\"EPSG\",\"9108\"]],AXIS[\"Lat\",NORTH],AXIS[\"Long\",EAST],AUTHORITY[\"EPSG\",\"4326\"]]"; MgEnvelope env = new MgEnvelope(10,10,20,20); MgMap map1 = new MgMap(); map1.Create(coordsys, env, "map1"); MgMap map2 = new MgMap(); map2.Create(coordsys, env, "map2"); MgMap map3 = new MgMap(); map3.Create(coordsys, env, "map3"); MgMap map4 = new MgMap(); map4.Create(coordsys, env, "map4"); MgMapCollection coll = new MgMapCollection(); coll.Add(map1); coll.Insert(1, map2); coll.Add(map3); Assert.AreEqual(3, coll.Count); Assert.AreEqual(coll[2].GetName(), "map3"); coll[1] = map4; string txt = ""; foreach (MgMap map in coll) { txt += "[" + map.GetName() + "]"; } Assert.AreEqual("[map1][map4][map3]", txt); }