grid_building_system_integration_test

AUTO-GENERATED FILE – DO NOT EDIT MANUALLY

============================================================================== BEHAVIOR CONTRACTS

Source File: /addons/grid_building/test/placement/workflows/grid_building_system_integration_test.gd

Extends: GdUnitTestSuite

Properties

  • Property: runner: GdUnitSceneRunner
  • Property: env: [AllSystemsTestEnvironment](./all-systems-test-environment/)
  • Property: always_fail_base_rule: [PlacementRule](./placement-rule/) = preload("res://addons/grid_building/test/resources/rules/always_fail_base_rule.tres")
  • Property: tile_rule: [TileCheckRule](./tile-check-rule/) = preload("res://addons/grid_building/test/resources/rules/test_tile_check_rule.tres")
  • Property: collision_rule: [CollisionsCheckRule](./collisions-check-rule/) = preload("res://addons/grid_building/test/resources/rules/test_collision_rule.tres")

Private Properties

  • Property: _container: [GBCompositionContainer](./gb-composition-container/) (private)
  • Property: _gts: [GridTargetingState](./grid-targeting-state/) (private)
  • Property: _manipulation_state: [ManipulationState](./manipulation-state/) (private)
  • Property: _building_system: [BuildingSystem](./building-system/) (private)
  • Property: _indicator_manager: [IndicatorManager](./indicator-manager/) (private)
  • Property: _targeting_system: [GridTargetingSystem](./grid-targeting-system/) (private)

Constants

  • Constant: GBTestIsolation := preload("res://test/helpers/gb_test_isolation.gd")
  • Constant: VALID_BUILD_POS: Vector2 = Vector2(64, 64)
  • Constant: ALTERNATIVE_BUILD_POS: Vector2 = Vector2(100, 100)
  • Constant: TARGET_POS: Vector2 = Vector2(200, 200)
  • Constant: COMPLEX_TARGET_POS: Vector2 = Vector2(150, 150)
  • Constant: FULL_WORKFLOW_POS: Vector2 = Vector2(128, 128)
  • Constant: TRANSITION_TEST_POS: Vector2 = Vector2(400, 400)
  • Constant: COLLISION_SHAPE_SIZE: Vector2 = Vector2(32, 32)
  • Constant: MAX_REASONABLE_COORDINATE: int = 1000
  • Constant: MIN_POLYGON_SPAN: int = 2
  • Constant: POLYGON_TEST_POS: Vector2 = Vector2(128, 128)
  • Constant: DEFAULT_COLLISION_LAYER: int = 1
  • Constant: DEFAULT_COLLISION_MASK: int = 1
  • Constant: MIN_EXPECTED_INDICATORS: int = 1

Public Methods

before

1
before() -> void

before_test

1
before_test() -> void

after

1
after() -> void

after_test

1
after_test() -> void

assert_placement_report_success

1
2
3
4
assert_placement_report_success(
    report: PlacementReport,
    context: String
) -> void

Common assertion helper for validating placement reports


assert_setup_successful

1
2
3
4
assert_setup_successful(
    setup_result: PlacementReport,
    context: String
) -> void

Common helper to validate successful setup with custom message


assert_collision_results_valid

1
2
3
4
assert_collision_results_valid(
    collision_results: Dictionary,
    context: String
) -> void

Common assertion helper for collision detection results


test_complete_building_workflow

1
test_complete_building_workflow() -> void

Test complete building workflow from start to finish Tests the full building process including indicator setup, validation, and placement


test_enter_build_mode_honors_ignore_base_rules

1
test_enter_build_mode_honors_ignore_base_rules() -> void

test_enter_build_mode_with_no_rules_is_valid_when_ignore_base_rules_is_false

1
test_enter_build_mode_with_no_rules_is_valid_when_ignore_base_rules_is_false() -> void

test_enter_build_mode_with_no_rules_is_valid_when_ignore_base_rules_is_true

1
test_enter_build_mode_with_no_rules_is_valid_when_ignore_base_rules_is_true() -> void

test_multi_rule_indicator_attachment

1
test_multi_rule_indicator_attachment() -> void

test_rule_indicator_state_synchronization

1
test_rule_indicator_state_synchronization() -> void

test_indicators_are_parented_and_inside_tree

1
test_indicators_are_parented_and_inside_tree() -> void

test_smithy_indicator_generation

1
test_smithy_indicator_generation() -> void

test_smithy_collision_detection

1
test_smithy_collision_detection() -> void

test_complex_multi_system_workflow

1
test_complex_multi_system_workflow() -> void

Test build and then post build move manipulation


test_polygon_test_object_indicator_generation

1
test_polygon_test_object_indicator_generation() -> void

test_polygon_collision_integration

1
test_polygon_collision_integration() -> void

test_grid_targeting_highlight_integration

1
test_grid_targeting_highlight_integration() -> void

test_targeting_state_transitions

1
test_targeting_state_transitions() -> void

test_full_system_integration_workflow

1
test_full_system_integration_workflow() -> void

Test full system integration workflow with collision detection Tests the complete building system including indicator setup, collision detection, and placement


test_system_error_recovery

1
test_system_error_recovery() -> void

test_building_system_reports_success_failure_correctly

1
test_building_system_reports_success_failure_correctly() -> void

Test: BuildingSystem reports success only when PlacementReport.is_successful() is true Setup: BuildingSystem with valid placeable, check PlacementReport consistency Act: Perform builds with different success/failure scenarios Assert: PlacementReport.is_successful() matches expected success/failure state


Private Methods

_validate_environment_setup

1
_validate_environment_setup() -> void

Flags: private

Validate environment is properly set up without issues


_validate_required_dependencies

1
_validate_required_dependencies() -> void

Flags: private

Validate all required dependencies are available


_enter_build_mode_successfully

1
_enter_build_mode_successfully(placeable: Placeable) -> bool

Flags: private

Common helper to enter build mode with proper error handling


_set_targeting_position

1
_set_targeting_position(position: Vector2) -> void

Flags: private

Common helper to set targeting position


_find_collision_objects_recursive

1
2
3
4
_find_collision_objects_recursive(
    node: Node,
    found_objects: Array[Node2D]
) -> void

Flags: private

Find collision objects in scene hierarchy


_cleanup_test_state

1
_cleanup_test_state() -> void

Flags: private

Common cleanup helper


_create_ignore_base_rules_placeable

1
_create_ignore_base_rules_placeable() -> Placeable

Flags: private


_create_test_placeable

1
2
3
4
_create_test_placeable(
    p_ignore_base_rules: bool,
    p_rules: Array[PlacementRule]
) -> Placeable

Flags: private


_assert_polygon_spans_coordinates

1
_assert_polygon_spans_coordinates(collision_tiles: Dictionary) -> void

Flags: private

Helper to validate polygon collision pattern



Grid Building v5.0.8 | Generated 24/05/2026