예제 #1
0
        public void DetermineColumnFormatFillGuessColumnFormatWriter()
        {
            var reader = new CsvFile
            {
                ID             = "Reader",
                FileName       = Path.Combine(m_ApplicationDirectory, "BasicCSV.txt"),
                HasFieldHeader = true
            };

            ApplicationSetting.ToolSetting.Input.Clear();
            ApplicationSetting.ToolSetting.Input.Add(reader);
            var mimic = new MimicSQLReader();

            mimic.AddSetting(reader);

            reader.FileFormat.FieldDelimiter = ",";
            var writer = new CsvFile
            {
                SqlStatement = reader.ID
            };

            ApplicationSetting.ToolSetting.Output.Clear();
            ApplicationSetting.ToolSetting.Output.Add(writer);

            // setting.TreatTextNullAsNull = true;
            ApplicationSetting.FillGuessSettings.IgnoreIdColums = false;
            using (var processDisplay = new DummyProcessDisplay())
            {
                writer.FillGuessColumnFormatWriter(true, processDisplay.CancellationToken);
                Assert.AreEqual(6, writer.Column.Count);
            }
        }