public IEnumerable<InputFileParameter> LoadInput()
 {
     var rowCount = 50;
     var fileName = UtilHelper.generateCsvFile(rowCount);
     IFormatHelper formatter = new CsvFormatHelper();
     var records = formatter.LoadFile<InputFileParameter>(fileName);
     return records;
 }
Example #2
0
        public IEnumerable <InputFileParameter> LoadInput()
        {
            var           rowCount  = 50;
            var           fileName  = UtilHelper.generateCsvFile(rowCount);
            IFormatHelper formatter = new CsvFormatHelper();
            var           records   = formatter.LoadFile <InputFileParameter>(fileName);

            return(records);
        }
        public void UT_GetAlias()
        {
            try
            {
                IFormatHelper formatter = new CsvFormatHelper();
                Assert.IsNotNull(formatter.getAlias());

                Assert.IsTrue(formatter.getAlias().ToLowerInvariant().CompareTo("csv")==0);
            }
            catch
            {
                Assert.IsTrue(false);
            }
        }
Example #4
0
        public void UT_GetAlias()
        {
            try
            {
                IFormatHelper formatter = new CsvFormatHelper();
                Assert.IsNotNull(formatter.getAlias());

                Assert.IsTrue(formatter.getAlias().ToLowerInvariant().CompareTo("csv") == 0);
            }
            catch
            {
                Assert.IsTrue(false);
            }
        }
        public void UT_WriteOutput()
        {
            try
            {
                var records = LoadInput();
                Assert.IsNotNull(records);

                var outputFile = Path.GetTempFileName();
                IFormatHelper formatter = new CsvFormatHelper();
                formatter.WriteOutputFile<InputFileParameter>(records, outputFile);

                var records2 = formatter.LoadFile<InputFileParameter>(outputFile);
                Assert.IsTrue(records2.Count() == 50);
            }
            catch
            {
                Assert.IsTrue(false);
            }
        }
Example #6
0
        public void UT_WriteOutput()
        {
            try
            {
                var records = LoadInput();
                Assert.IsNotNull(records);

                var           outputFile = Path.GetTempFileName();
                IFormatHelper formatter  = new CsvFormatHelper();
                formatter.WriteOutputFile <InputFileParameter>(records, outputFile);

                var records2 = formatter.LoadFile <InputFileParameter>(outputFile);
                Assert.IsTrue(records2.Count() == 50);
            }
            catch
            {
                Assert.IsTrue(false);
            }
        }