Example #1
0
 def test_rentBikeOnWeeklyBasis_for_zero_number_of_bikes(self):
     shop = BikeRental(10)
     self.assertEqual(shop.rentBikeOnWeeklyBasis(0), None)
Example #2
0
 def test_rentBikeOnDailyBasis_for_valid_positive_number_of_bikes(self):
     shop = BikeRental(10)
     hour = datetime.now().hour
     self.assertEqual(shop.rentBikeOnDailyBasis(2).hour, hour)
Example #3
0
 def test_rentBikeOnDailyBasis_for_invalid_positive_number_of_bikes(self):
     shop = BikeRental(10)
     self.assertEqual(shop.rentBikeOnDailyBasis(11), None)
Example #4
0
 def test_rentBikeOnDailyBasis_for_negative_number_of_bikes(self):
     shop = BikeRental(10)
     self.assertEqual(shop.rentBikeOnDailyBasis(-1), None)
Example #5
0
    def test_Bike_Rental_diplays_correct_stock(self):

        shop1 = BikeRental()
        shop2 = BikeRental(10)
        self.assertEqual(shop1.displaystock(), 0)
        self.assertEqual(shop2.displaystock(), 10)
Example #6
0
 def test_display_correct_stocks(self):
     shop1 = BikeRental(30)
     shop2 = BikeRental(15)
     self.assertEqual(shop1.displayStock(), 30, 'should be 30')
     self.assertEqual(shop2.displayStock(), 15, 'should be 15')
Example #7
0
 def test_hourly_rent(self):
     shop = BikeRental(10)
     hour = datetime.now().hour
     self.assertEqual(shop.rentBikeOnHour(2).hour, hour, 'no assertion')
Example #8
0
 def test_negative_number_of_bikes(self):
     shop = BikeRental(10)
     self.assertEqual(shop.rentBikeOnHour(-3), None, 'should be None')
     self.assertEqual(shop.rentBikeOnHour(0), None, 'should be None')