Beispiel #1
0
        public void Basic_list_should_be_created_for_basic_cars()
        {
            var car     = new PopularFamilyCar();
            var factory = PricingFactory.Create();

            var policy = factory.GetPolicyFor(car);

            Assert.IsInstanceOfType(policy, typeof(PopularFamilyCarPricing));
        }
Beispiel #2
0
        public void Rental_prices_should_account_for_days_and_kilometers()
        {
            IVehicle carType = new PopularFamilyCar();
            var      request = BuildRentalRequest(new PopularFamilyCar(), 4, 600);
            var      factory = PricingFactory.Create();

            var rental = new RentalStore(factory).Rent(request);

            Assert.AreEqual(4, rental.Days);
            Assert.AreEqual(200M, rental.TotalDailyPrice);
            Assert.AreEqual(300M, rental.EstimatedTotalKmPrice);
            Assert.AreEqual(500M, rental.TotalPrice);
        }