public void LoadIntoDatabase()
        {
            var records = ParserHelper.ParseRecords(Records);

            using (var connection = _fixture.CreateConnection())
            {
                connection.Open();
                var loader = new LocationLoader(connection, new Sequence(), Substitute.For <ILogger>());
                loader.Initialise();

                foreach (var record in records)
                {
                    loader.Add(record);
                }

                using (var transaction = connection.BeginTransaction())
                {
                    loader.Load(transaction);

                    using (var command = connection.CreateCommand())
                    {
                        command.Transaction = transaction;
                        command.CommandText = "SELECT * FROM Locations";
                        using (var adapter = new SqlDataAdapter(command))
                        {
                            var table = new DataTable();
                            adapter.Fill(table);
                            Assert.Equal(4, table.Rows.Count);
                        };
                    }
                }
            }
        }
        /// <summary>
        /// Fetches the UN/LOCODE files from UNECE server and parses the content.
        /// </summary>
        /// <returns>
        /// An object containing a list of <see cref="Location"/> and <see cref="Country"/>.
        /// </returns>
        public LoaderResult LoadFromUnece()
        {
            using (var workspace = new Workspace())
            {
                var folder = workspace.WorkingFolder;

                EmitInfo("Download UN/LOCODE and extract.");

                var file = _fileDownloader.DownloadTemp(UnlocFileUrl);

                Extract(file, folder);

                var countries = _countryLoader.Load(folder);
                var locations = _locationLoader.Load(folder, countries);

                return(new LoaderResult(locations, countries));
            }
        }