Ejemplo n.º 1
0
        public void Test_ReadXml_WriteCsv_Kunden()
        {
            using (var testPipeline = new Pipeline())
            {
                var reader = new XmlFileReader()
                {
                    File     = this.testDataPath + @"kunden.xml",
                    RowXPath = "/adre/kunde"
                };
                reader.Formatter = new XPathToDataTableFormatter();
                testPipeline.Commands.Add(reader);

                var writer = new FlatFileWriter()
                {
                    File = this.resultPath + @"kunden.csv"
                };
                writer.Formatter = new DataTableToCsvFormatter();
                reader.AddChild(writer);

                testPipeline.ExecutePipeline();
            }

            // check
            var targetlineCount = File.ReadLines(this.resultPath + @"kunden.csv").Count();

            Assert.AreEqual(3, targetlineCount);
        }