public void TestImportExport() { CreateTestTypesTable(TestConnectrionString); var tableInfo = DataHelper.GetTableInfo("TestTypes", TestConnectrionString); Assert.IsNotNull(tableInfo); var sourceFilePath = AppDomain.CurrentDomain.BaseDirectory + @"..\..\Data\TestTypes_2018-05-06.txt"; var rowList = SqlImport.ReadDataFromFile(tableInfo, sourceFilePath); Assert.IsNotNull(rowList); var cmd = DataHelper.BuildCommand(tableInfo, rowList); DataHelper.UpdateTable(tableInfo, rowList, cmd, TestConnectrionString); var rowListDB = SqlExport.ReadFromQuery(tableInfo, TestSelectScript, TestConnectrionString); var fileName = AppDomain.CurrentDomain.BaseDirectory + @"..\..\Data\" + tableInfo.TableName + DateTime.Now.ToString("_yyyy-MM-dd_hh-mm") + ".txt"; if (File.Exists(fileName)) { File.Delete(fileName); } WriteDataToFile(rowList, fileName); Assert.AreEqual(CheckMD5(sourceFilePath), CheckMD5(fileName)); File.Delete(fileName); }
static async Task Main(string[] args) { DataRetriever dataRetriever = new DataRetriever(); ModelContainer mc = await dataRetriever.RetrieveAll(); SqlExport exporter = new SqlExport(); exporter.Export(mc); int stopher = 0; Console.WriteLine("All done!"); }