def test_full_point(self): exchange_point = simulation_item_factory.create_simulation_exchange_point() point_proxy = ExchangePointProxy(proxied_point=exchange_point) point_proxy.capacity = 10 books_pool = [simulation_item_factory.create_simulation_book() for book in range(0, int(point_proxy.capacity/2))] for book in books_pool: point_proxy.put_book(book) self.assertTrue(point_proxy.point_is_not_full())
def test_put_get_book(self): exchange_point = simulation_item_factory.create_simulation_exchange_point() point_proxy = ExchangePointProxy(proxied_point=exchange_point) book = simulation_item_factory.create_simulation_book() point_proxy.put_book(book) self.assertTrue(len(point_proxy.proxied_point.stored_books) == 1) gotten_book = point_proxy.get_book() self.assertEqual(gotten_book , book) self.assertTrue(len(point_proxy.proxied_point.stored_books) == 0)
def test_put_get_book(self): exchange_point = simulation_item_factory.create_simulation_exchange_point( ) point_proxy = ExchangePointProxy(proxied_point=exchange_point) book = simulation_item_factory.create_simulation_book() point_proxy.put_book(book) self.assertTrue(len(point_proxy.proxied_point.stored_books) == 1) gotten_book = point_proxy.get_book() self.assertEqual(gotten_book, book) self.assertTrue(len(point_proxy.proxied_point.stored_books) == 0)
def test_full_point(self): exchange_point = simulation_item_factory.create_simulation_exchange_point( ) point_proxy = ExchangePointProxy(proxied_point=exchange_point) point_proxy.capacity = 10 books_pool = [ simulation_item_factory.create_simulation_book() for book in range(0, int(point_proxy.capacity / 2)) ] for book in books_pool: point_proxy.put_book(book) self.assertTrue(point_proxy.point_is_not_full())