-
Notifications
You must be signed in to change notification settings - Fork 1
NPC test sprint3
To test whether the npcs&dialogues we created met our requirements, we created a series of tests for it to help us confirm its accuracy.
Tested for dialogue text loading, changes, item addition, new npc positions and dialog button positions.
All the test classes are written in the NpcTest.java file.
Path:
1.Test that the text in the dialog box loads.
2.Test whether the text of each NPC can be corresponded to.
3.Test that the text in the dialog box is loaded correctly according to the change in value.
4.Test whether items can be added to the inventory.
5.Test to see if the correct NPC has added items to the inventory.
6.Iterate for the old NPC location test. Test if the NPC is at the new location.Whether the new NPC location is in the map.
7.Test that the dialog box buttons are in the correct position.
Start testing with the Junit5 test format. Create variables for the classes that will be tested.
Initialize and assign values to variables.Simulates npc's that interact by changing their names.
Add a prerequisite to each NPC to determine whether the corresponding parameter needs to be added and whether the item needs to be added based on this condition.(I know that the if condition is fixed, but I wanted to write it out to facilitate better understanding.If a change is made to the value of the variable above, the test will fail.)
Create dialogue for each NPC to facilitate testing.
Test that the text in the dialog box is loaded correctly according to the change in value.Each npc has a corresponding test.
Tests of text were created for humanGuard, friendlyCreature and plumberFriend. An error is reported when the variable is larger than the number of conversations available.
Test if items have been added to the inventory. When changing the name of an NPC, it looks to see if the npc has an item, and the test succeeds when the names of the three NPCs with items are set. My preset is plumberFriend.
- Bokai Zhang
- GitHub: hideonbush-crl
- Discord: Bkai Z(bokai)#6469