Example #1
0
        public void TestGetPrice()
        {
            var rental = new HourlyRental();

            rental.BeginDate = DateTime.Now;
            rental.EndDate   = rental.BeginDate.AddHours(3);
            Assert.AreEqual(rental.GetPrice(), 15m);
        }
Example #2
0
        public void FamilyRentTest()
        {
            double totalByHour = _hourlyRental.GetPrice() * _hourlyRental.GetTime() * _hourlyRental.GetNumberOfBikes();
            double totalByDay  = _dailyRental.GetPrice() * _dailyRental.GetTime() * _dailyRental.GetNumberOfBikes();
            double totalByWeek = _weeklyRental.GetPrice() * _weeklyRental.GetTime() * _weeklyRental.GetNumberOfBikes();
            double total       = (totalByHour + totalByDay + totalByWeek) * 0.7;

            Assert.AreEqual(total, _familyRental.Rent(), 0);
        }
Example #3
0
 public void PriceTest()
 {
     _hourlyRental = new HourlyRental(2, 5);
     Assert.AreEqual(5.0, _hourlyRental.GetPrice(), 0.01);
 }