Esempio n. 1
0
        public void PriceForNewTitleIsCorrect()
        {
            int     bonusPoints   = 0;
            var     titleType     = VideoTitle.TitleType.New;
            int     dayCount      = 3;
            decimal expectedPrice = newTitleTerms.TrailingFee * dayCount;

            var terms = policy.CalculateRentalOptions(titleType, dayCount, bonusPoints);

            Assert.AreEqual(expectedPrice, terms.Price);
        }
Esempio n. 2
0
        /// <summary>
        /// Return the options for the rental of the film - price and possibility to pay with bonus points.
        /// </summary>
        /// <param name="customerId">ID of the customer.</param>
        /// <param name="titleType">the type of the film.</param>
        /// <param name="dayCount">the number of days to rent.</param>
        /// <returns>Rental options for the customer and the video title.</returns>
        public RentalOptions GetRentalOptions(int customerId, VideoTitle.TitleType titleType, int dayCount)
        {
            int bonusPoints = repository.GetCustomer(customerId).BonusPoints;

            return(pricePolicy.CalculateRentalOptions(titleType, dayCount, bonusPoints));
        }