public void Populate()
        {
            const string testDataFile =
                @"GeoDataFiles\US10000.txt";

            var log = new Log();
            var geoRepository = new MongoGeoDataStore(ConnectionString, MongoDbName);
            var geoDataImporter = new GeoDataImporter(log, geoRepository);
            geoDataImporter.ImportGeonamesFrom(testDataFile);
        }
        public void ShouldImport()
        {
            const string fileName =
                @"GeoDataFiles\US10000.txt";

            var log = new Log();
            var geoRepository = new MongoGeoDataStore("mongodb://localhost", "geonamestest");
            var geoDataImporter = new GeoDataImporter(log, geoRepository);
            geoDataImporter.ImportGeonamesFrom(fileName);

            Geoname geoName = geoRepository.ByGeonameId(7723040);
            Assert.That(geoName != null);
        }
        static void Main(string[] args)
        {
            bool doImport = AreThereValidParametersForDataImportIn(args);

            var geoRepository = new MongoGeoDataStore();
            if(doImport)
            {
                Console.WriteLine("Started import at: {0}", DateTime.Now.ToShortTimeString());
                var importer = new GeoDataImporter(new Log(), geoRepository);
                importer.ImportGeonamesFrom(args[1]);
                Console.WriteLine("Finished import at: {0}", DateTime.Now.ToShortTimeString());
                Console.WriteLine("No. of geonames in DB: {0}", geoRepository.GeonamesCount());
            }

            Console.ReadKey();
        }