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()); }
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); }