'Calls the manager\'s get_collected method and verifies its result
and behavior.'

def collect_and_verify(self, expect_modulestore_called, expect_cache_updated):

    self.modulestore.get_items_call_count = 0
    self.cache.set_call_count = 0
    with mock_registered_transformers(self.registered_transformers):
        block_structure = self.bs_manager.get_collected()
    self.assert_block_structure(block_structure, self.children_map)
    TestTransformer1.assert_collected(block_structure)
    if expect_modulestore_called:
        self.assertGreater(self.modulestore.get_items_call_count, 0)
    else:
        self.assertEquals(self.modulestore.get_items_call_count, 0)
    self.assertEquals(self.cache.set_call_count, (1 if expect_cache_updated else 0))
