public void SetUp()
        {
            tipCalculatorService = Resolve <ITipCalculatorService>();
            rateList             = new List <RateBE>
            {
                new RateBE("EUR", "USD", 0.87m),
                new RateBE("USD", "EUR", 1.15m),
                new RateBE("EUR", "CAD", 0.73m),
                new RateBE("CAD", "EUR", 1.37m),
                new RateBE("USD", "AUD", 1.37m),
                new RateBE("AUD", "USD", 0.73m)
            };
            tipCalculatorService.GenerateGraph(rateList);
            transactionBE = new TransactionBE("T001", 10, "EUR");

            transactionList = new List <TransactionBE>
            {
                transactionBE
            };
            tipBE = new TipBE("T001", 10, 0.50m, "EUR");
            List <TipBE> tipList = new List <TipBE>
            {
                tipBE
            };

            billBE = new BillBE(0.44m, "USD", tipList);
        }
        public BillBE GetBill(List <RateBE> rateList, List <TransactionBE> transactionList, string currency)
        {
            BillBE       result         = null;
            decimal      rateValue      = 0;
            decimal      finalTipAmount = 0;
            List <TipBE> tipList        = new List <TipBE>();

            try
            {
                for (int i = 0; i < transactionList.Count; i++)
                {
                    rateValue = Math.Round(GetTransactionAmount(transactionList[0], currency), 2);

                    decimal tipAmount = Math.Round(transactionList[i].Amount * 0.05m, 2);

                    TipBE tip = new TipBE(transactionList[i].Sku, transactionList[i].Amount,
                                          tipAmount, transactionList[i].Currency);

                    finalTipAmount += Math.Round(tipAmount * rateValue, 2);

                    tipList.Add(tip);
                }
                result = new BillBE(Math.Round(finalTipAmount, 2), currency, tipList);
            }
            #region Exceptions
            catch (ArgumentOutOfRangeException e)
            {
                Log.Error(e.Message);
                Log.Warning(e.StackTrace);
                throw new VuelingExamDomainException(e.Message, e.InnerException);
            }
            catch (OverflowException e)
            {
                Log.Error(e.Message);
                Log.Warning(e.StackTrace);
                throw new VuelingExamDomainException(e.Message, e.InnerException);
            }
            catch (ArgumentNullException e)
            {
                Log.Error(e.Message);
                Log.Warning(e.StackTrace);
                throw new VuelingExamDomainException(e.Message, e.InnerException);
            }
            #endregion
            return(result);
        }