public void ContinentComposer_ComposesFileCorrectly() { var src = @"testdata\test_continentCodes.txt"; var dst = @"testdata\test_continentCodes.out.txt"; GeoFileWriter.WriteContinents(dst, GeoFileReader.ReadContinents(src)); FileUtil.EnsureFilesAreFunctionallyEqual(src, dst, 3, 0, new[] { '\t' }, Encoding.UTF8, true); }
public void ContinentParser_ParsesFileCorrectly() { var target = GeoFileReader.ReadContinents(@"testdata\test_continentCodes.txt").ToArray(); Assert.AreEqual(1, target.Length); //First line in file should've been skipped Assert.AreEqual("EU", target[0].Code); Assert.AreEqual("Europe", target[0].Name); Assert.AreEqual(6255148, target[0].GeoNameId); }
public void FileReader_Continent_StreamOverload() { using (var s = File.OpenRead(@"testdata\test_continentCodes.txt")) GeoFileReader.ReadContinents(s).Count(); }