Skip to content

Inventory Component Unit Testing

TimothyLam123 edited this page Oct 18, 2022 · 4 revisions

Introduction

This testing plan is only for Unit test for InventoryComponent.

Path for InventoryComponent and InventoryComponnet

268b3fe2f37174306e374fa6ae88b49 ee2dd61b785db204f6c4f64e117e8ad

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.

  1. Be able to create an empty inventory
  2. Be able to set combat animation, register animation, and cancel animation.
  3. Be able to equip, unequip or swap equiped weapon or armour
  4. Be able to get or remove equiped weapon or armour
  5. Be able to add or remove item, and sort the same items in the same slots
  6. Be able to check whether a item is in inventory
  7. Be able to check how many items in one slots
  8. Be able to apply weapon's or armour's effect to player while the player equip them
  9. Be able to open inventory back pack
  10. 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.

184a6476d087692b363dbcabebec642 f43bb1c24e4c39e606c1875e98489ad

Testing create empty inventory.

402ae10d7679a5598d03bbf6f840467

Testing combat animator

fedd743f5cb2c65b1efab289d467fbb

Testing equip weapon or armour

30c5dd4e5b06d56ebf6f3a3a779e9c3

Testing add item and remove item

dc610bfde8e6489598308032f6474f9 eb3b75e2ccc98b48a865348907f2505

Testing has item and items quantity

9a67a3e6e9001237ea46e549ed0a9ad

Testing apply effects to player

dc3454087354908434f78cdc5aa26f2

Testing open inventory backpack

52545a7a37d24f0aec5b22c8c24c9bf

Testing add item to quick bar and get item from quick bar

4682a3894dcd599593f60245f574c24 29922e2b333e8dded9ef317e24a293d

Back to Inventory Page

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
Clone this wiki locally