Skip to content

Map Generation Testing Plan

Ethan Roderick edited this page Sep 1, 2021 · 1 revision

Sprint 1

Tested

Created tests for two classes:

  • MapRoom

    • getRoomBounds - Tested finding two opposing corners of a room.
    • isInBounds - Test a position being inside of room's bounds, and outside of a room's bounds.
    • getSymbolsToPaths - Test if the two room maps can be used to correctly generate a third map. Key1 : Value1 and Key2 : Value2 to Key1 : Value1.
    • testToString - Check the room's values properly convert to string.
  • MapLevel

    • getMaxSize - Check the combined width of all rooms and the combined height of all rooms.
    • isInBounds - Check if a position can be identified as inside one of a collection of rooms.
    • findRoom - Check if giving coordinates within a room's bound return's that room. Also check if giving invalid coordinates returns no room.

Future Testing

  • RoomLoader - Introduced in Sprint 1. Does not have any testing.
    • Needs both public methods tested. Was not tested in this sprint as it would involve testing with test files which seemed too elaborate for unit tests.
    • Tests could be constructed to create test files for single use.
  • LevelTerrainGenerator - Introduced in Sprint 1. Does not have any testing.
    • Needs testing of public methods. Not tested for same reasons as above.
    • Tests could be constructed to create test files for single use.
Clone this wiki locally