Exemplo n.º 1
0
 static void Main(string[] args)
 {
     IFileToBeProcessed fileInfo = new FileToBeProcessed(new ConfigurationHelper().GetConfig("AppSettings", "Directories", "Source"),
                                                         new ConfigurationHelper().GetConfig("AppSettings", "Directories", "Destination"),
                                                         FileUtility.ReadCityAndZipCode(new ConfigurationHelper().GetConfig("AppSettings", "Directories", "Source"))
                                                         );
     ProcessInputFile file = new ProcessInputFile(fileInfo);
     int countOfCities     = file.ProcessWeatherInfo();
 }
Exemplo n.º 2
0
        public ActionResult <IEnumerable <string> > Get()
        {
            string             inputFile = new ConfigurationHelper().GetConfig("AppSettings", "Directories", "Source") + "\\" + "ExampleData.txt";
            IFileToBeProcessed fileInfo  = new FileToBeProcessed(inputFile,
                                                                 new ConfigurationHelper().GetConfig("AppSettings", "Directories", "Destination"),
                                                                 FileUtility.ReadCityAndZipCode(inputFile));
            ProcessInputFile file = new ProcessInputFile(fileInfo);
            int countOfCities     = file.ProcessWeatherInfo();

            return(new string[] { "CitiesProcessed", Convert.ToString(countOfCities) });
        }
Exemplo n.º 3
0
        public void Test1()
        {
            #region Arrange
            var mockedFile = new Mock <IFileToBeProcessed>();
            Dictionary <string, string> testCities = new Dictionary <string, string>();
            testCities.Add("Mumbai", "1275339");
            testCities.Add("Delhi", "1273294");
            IFileToBeProcessed fileToBe = new FileToBeProcessed("D:\\SourceFiles\\ExampleData - Copy.txt", "D:\\newOutput", testCities);

            var process = new ProcessInputFile(fileToBe);
            #endregion
            #region Act
            var result = process.ProcessWeatherInfo();
            #endregion
            #region Assert
            Assert.Equal(2, result);
            #endregion
        }