Exemplo n.º 1
0
        public void GeoNamesComposerSimple_ComposesFileCorrectly()
        {
            // In this test we test the "compact file format" (e.g. GeoName, not ExtendedGeoName)
            var src = @"testdata\test_geonames_simple.txt";
            var dst = @"testdata\test_geonames_simple.out.txt";

            GeoFileWriter.WriteGeoNames(dst, GeoFileReader.ReadGeoNames(src, false), false);

            FileUtil.EnsureFilesAreFunctionallyEqual(src, dst, 4, 0, new[] { '\t' }, Encoding.UTF8, false);
        }
Exemplo n.º 2
0
        public void GeoNamesComposerExtended_ComposesFileCorrectly()
        {
            // In this test we test the "extended file format" (e.g. ExtendedGeoName, not GeoName)
            // But since GeoName cannot provide all values, all other properties should be null/empty when writing
            var src = @"testdata\test_geonames_ext.txt";
            var dst = @"testdata\test_geonames_ext.out.txt";

            GeoFileWriter.WriteGeoNames(dst, GeoFileReader.ReadGeoNames(src, true), true);

            FileUtil.EnsureFilesAreFunctionallyEqual(src, dst, 19, 0, new[] { '\t' }, Encoding.UTF8, false);
        }