Beispiel #1
0
        public static List <CsvMappingResult <WeatherDetails> > readFile(String path)
        {
            CsvParserOptions           csvParserOptions = new CsvParserOptions(true, ',');
            WeatherMapping             csvMapper        = new WeatherMapping();
            CsvParser <WeatherDetails> csvParser        = new CsvParser <WeatherDetails>(csvParserOptions, csvMapper);

            return(csvParser
                   .ReadFromFile($@"{path}", Encoding.ASCII)
                   .ToList());
        }
Beispiel #2
0
        public WeatherServiceTest()
        {
            var userStore = Mock.Of <IUserStore <User> >();

            this.userManager = new Mock <UserManager <User> >(userStore, null, null, null, null, null, null, null, null);

            var weatherMappingProfile = new WeatherMapping();

            checkWXAPIMetarService = new Mock <ICheckWXAPIMetarService>();

            checkWXAPIStationService = new Mock <ICheckWXAPIStationService>();

            var configuration = new MapperConfiguration(cfg => cfg.AddProfile(weatherMappingProfile));

            mapper = new Mapper(configuration);

            weatherService = new WeatherService(checkWXAPIMetarService.Object, userManager.Object, mapper, checkWXAPIStationService.Object);
        }