public void TestRoundTrip(string filename) { // // can't round trip since I added the ToExternal/ ToInternal to the shapefile readers and writers. // PrecisionModel pm = new PrecisionModel(); GeometryFactory geometryFactory = new GeometryFactory(pm, -1); int differenceCount = 0; string testName = ""; string srcShpFilename = Global.GetUnitTestRootDirectory() + @"\IO\Shapefile\Testfiles\" + filename; string destShpFilename = Global.GetUnitTestRootDirectory() + @"\IO\Shapefile\Testfiles\testroundtrip" + filename; // do the round trip ShapefileReader shpReader = new ShapefileReader(srcShpFilename + ".shp", geometryFactory); GeometryCollection shapes = shpReader.ReadAll(); new ShapefileWriter(destShpFilename, geometryFactory).WriteGeometryCollection(shapes); // perfom binary compare on the .shp testName = String.Format("Test round trip .shp - {0}", filename); differenceCount = Compare.BinaryCompare(srcShpFilename + ".shp", destShpFilename + ".shp"); Assertion.AssertEquals(testName, 0, differenceCount); // perfom binary compare on the .shx file testName = String.Format("Test round trip .shx - {0}", filename); differenceCount = Compare.BinaryCompare(srcShpFilename + ".shx", destShpFilename + ".shx"); Assertion.AssertEquals(testName, 0, differenceCount); }