-
Notifications
You must be signed in to change notification settings - Fork 9
Configuration and MapGameArea Test Plan
No testing will be performed on the EntityConfig classes, as there is no functionality explicitly defined in this function.
The GameAreaConfig
only has a single method to be tested - getEntityTextures()
. This method was tested by a series of tests that ensure that any number of entities that are in the game area return all the textures they require. The tests are:
-
getEntityTexturesReturnsSingleConfig()
-> Single entity -
getEntityTexturesReturnsAllDistinct()
-> Large list of entities with duplicate textures (must only return distinct textures) -
getEntityTexturesReturnsAllDistinct2()
-> Smaller list of entities with duplicate textures (must only return distinct textures) -
getEntityTexturesReturnsAllUnique()
-> List of entities with unique textures (should just return all textures)
The AreaEntityConfig
class has several methods to be tested, most of which pertain to adding entities to the entities hashmap. The tests are:
-
getAllEntities()
-> All entities in game area are returned when calling.getAllConfigs()
. -
getNoEntities()
->.getAllConfigs()
return an empty list when no entities have been added. -
addEntity()
-> Adding an entity to the map returns correctly using.getEntity()
and.getEntities()
. -
addDifferentClassEntities()
-> Adding mutliple different class entities to the hashmap results in two different entries into the map with the respective entities. -
addSameClassEntities()
-> Adding mutliple entities of the same class should append them to the list in the same entry of the map. -
addMultipleEntitesAtOnce()
-> Adding multiple entites at once using.addEntities()
gives same outcome as calling.addEntity()
repeatedly. -
addEntrytoMap()
-> Adding an entry to map should allow the same functionalty as if the entity was added. -
addMultipleEntriestoMap()
-> Should be able to add multiple entities of different types as entries and retrieve using.getEntity()
. -
addDuplicateEntriestoMap()
-> If multiple entries of same key are added an exception should be thrown.
The AssetsConfig
class has just the load()
and unload()
methods to test. The tests written are:
-
loadAndUnloadTexturePaths()
-> Loads and unloads all texture paths correctly -
loadAndUnloadTextureAtlasPaths()
-> Loads and unloads all texture atlas paths correctly -
loadAndUnloadSoundEffects()
-> Loads and unloads all sounds effects correctly -
loadAndUnloadParticleEffects()
-> Loads and unloads all particle effects correctly -
loadAndUnloadBackgroundMusic()
-> Loads and unloads the background music correctly
The MapGameArea
has to be tested by writing tests for each of the methods in the game area to ensure that the config file is being loaded appropriately and the function is dealing with edge cases appropriately. i.e. if a certain property is null in the config file what is the expected behaviour and does it crash? However, this is a very large scope of work and contains work from almost every team. This means that our team were unable to complete this work this sprint. However, next sprint we are aiming to have all the teams write tests for the methods that concern them. This reduces the workload from a single team and distributes it - making it more manageable. The other test methods that were written were:
-
constructorValidConfigPath()
-> Ensures that the game area loads a valid config path correctly -
constructorInvalidConfigPath()
-> Ensures the constructor throws an error when an invalid config path is given -
loadAndUnloadEntityTextures()
-> Ensures that entity textures are automatically loaded and unloaded (this is different to the assetsConfig).
All Entity
factories need to be tested to ensure that the config class being passed as a parameter to the factory is appropriately reflected in the Entity that is returned. This testing has been completed in sprint 2.
Escape Earth Game
Interaction Controller and Interactable Components
Game and Entity Configuration Files
Loading Game Configuration Files