def test_rentBikeOnWeeklyBasis_for_zero_number_of_bikes(self): shop = BikeRental(10) self.assertEqual(shop.rentBikeOnWeeklyBasis(0), None)
def test_rentBikeOnDailyBasis_for_valid_positive_number_of_bikes(self): shop = BikeRental(10) hour = datetime.now().hour self.assertEqual(shop.rentBikeOnDailyBasis(2).hour, hour)
def test_rentBikeOnDailyBasis_for_invalid_positive_number_of_bikes(self): shop = BikeRental(10) self.assertEqual(shop.rentBikeOnDailyBasis(11), None)
def test_rentBikeOnDailyBasis_for_negative_number_of_bikes(self): shop = BikeRental(10) self.assertEqual(shop.rentBikeOnDailyBasis(-1), None)
def test_Bike_Rental_diplays_correct_stock(self): shop1 = BikeRental() shop2 = BikeRental(10) self.assertEqual(shop1.displaystock(), 0) self.assertEqual(shop2.displaystock(), 10)
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')
def test_hourly_rent(self): shop = BikeRental(10) hour = datetime.now().hour self.assertEqual(shop.rentBikeOnHour(2).hour, hour, 'no assertion')
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')