Inventory Component Unit Testing - UQdeco2800/2022-studio-2 GitHub Wiki
Introduction
This testing plan is only for Unit test for InventoryComponent.
Path for InventoryComponent and InventoryComponnet
Testing plan
Aiming to the 100% coverage, we decided to test every function in InventoryCompoent. Hence there are all the things we need to test.
- Be able to create an empty inventory
- Be able to set combat animation, register animation, and cancel animation.
- Be able to equip, unequip or swap equiped weapon or armour
- Be able to get or remove equiped weapon or armour
- Be able to add or remove item, and sort the same items in the same slots
- Be able to check whether a item is in inventory
- Be able to check how many items in one slots
- Be able to apply weapon's or armour's effect to player while the player equip them
- Be able to open inventory back pack
- Be able to add items to quick bar and get item from quick bar
Testing code
Before testing, initialize all the staff that could be used.
Testing create empty inventory.
Testing combat animator
Testing equip weapon or armour
Testing add item and remove item
Testing has item and items quantity
Testing apply effects to player
Testing open inventory backpack
Testing add item to quick bar and get item from quick bar
Author
- Li-Sung Ou
- GitHub: @PeterOu8
- Discord: Secret Agent Randy Beans#6754
- Slack: Li-Sung Ou
Author
- Siu Ming Lam
- GitHub: @TimothyLam123
- Discord: Timothy_Lam#2101
- Slack: Siu Ming Lam