def test_update_given_intel_maps_vespene_geysers_properly(self): # Arrange intel = create_intel_response() man = IntelManager.IntelManager() # Act man.update_intel(intel) # Assert self.assertNotEqual(None, man.vespene_geysers[4306239489])
def test_update_given_intel_maps_spawning_pool_unit_properly(self): # Arrange intel = create_intel_response() man = IntelManager.IntelManager() # Act man.update_intel(intel) # Assert self.assertNotEqual(None, man.unit_data[89])
def test_update_given_intel_maps_ling_speed_upgrade_properly(self): # Arrange intel = create_intel_response() man = IntelManager.IntelManager() # Act man.update_intel(intel) # Assert self.assertNotEqual(None, man.upgrade_data[66])
def test_update_given_intel_maps_psi_storm_buff_properly(self): # Arrange intel = create_intel_response() man = IntelManager.IntelManager() # Act man.update_intel(intel) # Assert self.assertNotEqual(None, man.buff_data[28])
def test_update_given_intel_maps_destructible_rock_properly(self): # Arrange intel = create_intel_response() man = IntelManager.IntelManager() # Act man.update_intel(intel) # Assert self.assertNotEqual(None, man.destructibles[8776253521])
def test_is_vespene_geyser_given_vespene_geyser_returns_true(self): # Arrange intel = create_intel_response() man = IntelManager.IntelManager() man.update_intel(intel) # Act r = man.is_vespene_geyser(342) # Assert self.assertTrue(r)
def test_is_mineralfield_given_mineralfield_returns_true(self): # Arrange intel = create_intel_response() man = IntelManager.IntelManager() man.update_intel(intel) # Act r = man.is_mineralfield(483) # Assert self.assertTrue(r)
def test_is_worker_given_marine_returns_false(self): # Arrange intel = create_intel_response() man = IntelManager.IntelManager() man.update_intel(intel) # Act r = man.is_worker(48) # Assert self.assertFalse(r)
def test_is_worker_given_probe_returns_true(self): # Arrange intel = create_intel_response() man = IntelManager.IntelManager() man.update_intel(intel) # Act r = man.is_worker(84) # Assert self.assertTrue(r)
def test_is_destructible_given_mineralfield_returns_false(self): # Arrange intel = create_intel_response() man = IntelManager.IntelManager() man.update_intel(intel) # Act r = man.is_destructible(483) # Assert self.assertFalse(r)
def test_is_building_given_spawning_pool_returns_true(self): # Arrange intel = create_intel_response() man = IntelManager.IntelManager() man.update_intel(intel) # Act r = man.is_building(89) # Assert self.assertTrue(r)
def test_is_destructible_given_destructible_rock_returns_true(self): # Arrange intel = create_intel_response() man = IntelManager.IntelManager() man.update_intel(intel) # Act r = man.is_destructible(371) # Assert self.assertTrue(r)
def test_isBuilding_given_probe_returns_false(self): # Arrange intel = create_intel_response() man = IntelManager.IntelManager() man.update_intel(intel) # Act r = man.is_building(84) # Assert self.assertFalse(r)
def test_tech_requirements_given_spawning_pool_and_already_build_hatchery_returns_empty_list( self): # Arrange intel = create_intel_response() man = IntelManager.IntelManager() man.update_intel(intel) # Act res = man.tech_requirements(89) # Assert self.assertEqual([], res)
def test_tech_requirements_full_given_spawning_pool_returns_list_with_hatchery( self): # Arrange intel = create_intel_response() man = IntelManager.IntelManager() man.update_intel(intel) # Act res = man.tech_requirements_full(89) # Assert self.assertTrue(man.get_unit_type_data(86) in res)
def test_update_given_intel_response_adds_repeated_data_with_multiple_elements_to_intel_manager( self): # Arrange intel = create_intel_response() man = IntelManager.IntelManager() # Act man.update_intel(intel) # Assert self.assertEqual(len(intel.alliedWorkers), len(man.allied_workers)) self.assertEqual(len(intel.alliedUnits), len(man.allied_units)) self.assertEqual(len(intel.enemyVisibleWorkers), len(man.enemy_visible_workers)) self.assertEqual(len(intel.alliedBuildings), len(man.allied_buildings))
def test_update_given_intel_response_adds_repeated_data_with_one_element_to_intel_manager( self): # Arrange intel = create_intel_response() man = IntelManager.IntelManager() # Act man.update_intel(intel) # Assert self.assertEqual(len(intel.enemyVisibleBuildings), len(man.enemy_visible_buildings)) self.assertEqual(len(intel.enemyVisibleUnits), len(man.enemy_visible_units)) self.assertEqual(len(intel.enemyVisibleUnits), len(man.enemy_visible_units))