Пример #1
0
        public void 設定ファイルと入力ファイル読み込み出力する()
        {
            var conf = new ConfigReader("C:\\Users\\kero\\source\\repos\\MyApp\\UnitTestProject1\\テストデータ\\入力データ\\設定ファイル.txt");

            IReaderRepository input = new InputFileReader("C:\\Users\\kero\\source\\repos\\MyApp\\UnitTestProject1\\テストデータ\\入力データ\\INPUT.txt",
                                                          conf.GetLoopEntity());

            IWriterRepository writer = new OutputXMLFile("d:\\test\\sample.xml");

            writer.Open().IsTrue();
            input.Open();
            var line = input.GetLine();

            foreach (var data in line.DataLists)
            {
                Console.WriteLine(data.Value);
            }
            line.IsNotNull();

            writer.SetLine(line);
            line = input.GetLine();

            foreach (var data in line.DataLists)
            {
                Console.WriteLine(data.Value);
            }
            writer.SetLine(line);
            writer.Close();
        }
Пример #2
0
        static void Main(string[] args)
        {
            PolicyHelper  policyHelper  = new PolicyHelper();
            List <Policy> validPolicies = new List <Policy>();

            Console.WriteLine("Hello World!");
            try
            {
                validPolicies = new DataLoadFromCSVFile(@"E:\MaturityData.csv").GetValidPolicies();
                Console.WriteLine("Load Complete...");
            }
            catch (Exception e)
            {
                PrintExceptionMessage(e);
            }
            try
            {
                var result = new OutputXMLFile(validPolicies, policyHelper);
                result.CreateOutputFile(new XmlSerializer(typeof(List <PolicyDTO>), new XmlRootAttribute("MaturedPolicies")
                {
                    IsNullable = false
                }));
                Console.WriteLine("Creating XML File Complete...");
            }
            catch (Exception e)
            {
                PrintExceptionMessage(e);
            }

            Console.WriteLine("Press any key to exit...");
            Console.ReadKey();
        }