コード例 #1
0
        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);
        }
コード例 #2
0
 public void FetchTransactionsTest()
 {
     Assert.AreEqual(fetchedTransactions.GetType(),
                     fetchService.FetchTransactions().GetType());
 }