public bool FetchAndStore() { bool result = false; try { List <RateBE> fetchedRates = FetchService.FetchRates(); List <RateDM> ratesToStore = Mapper.MapList <RateBE, RateDM>(fetchedRates); RateRepository.CreateAll(ratesToStore); List <TransactionBE> fetchedTransactions = FetchService.FetchTransactions(); List <TransactionDM> transactionsToStore = Mapper.MapList <TransactionBE, TransactionDM>(fetchedTransactions); TransactionRepository.CreateAll(transactionsToStore); result = true; } #region Exceptions catch (VuelingExamDomainException e) { Log.Error(e.Message); Log.Warning(e.StackTrace); throw new VuelingExamApplicationException(e.Message, e.InnerException); } catch (VuelingExamInfrastructureException e) { Log.Error(e.Message); Log.Warning(e.StackTrace); throw new VuelingExamApplicationException(e.Message, e.InnerException); } #endregion return(result); }
public void SetUp() { ConfigHelper.CleanDatabase(); rateRepository = Resolve <IRateRepository>(); createdRateDMList = new List <RateDM>(); rateDMList = new List <RateDM> { new RateDM("RBR", "YEN", 15.55m), new RateDM("EUR", "PES", 23.32m), new RateDM("DOL", "COL", 0.25m) }; createdRateDMList = rateRepository.CreateAll(rateDMList); }