diff --git a/tests/domain/epc/test_construction_age_band_overlay.py b/tests/domain/epc/test_construction_age_band_overlay.py index 7527b9ea..3408900b 100644 --- a/tests/domain/epc/test_construction_age_band_overlay.py +++ b/tests/domain/epc/test_construction_age_band_overlay.py @@ -9,7 +9,12 @@ from __future__ import annotations import pytest -from datatypes.epc.domain.epc_property_data import BuildingPartIdentifier +from datatypes.epc.domain.epc_property_data import ( + BuildingPartIdentifier, + EpcPropertyData, + SapBuildingPart, +) +from domain.epc.construction_age_band import ConstructionAgeBand from domain.epc.property_overlays.construction_age_band_overlay import ( age_band_overlay_for, ) @@ -19,7 +24,9 @@ from tests.domain.sap10_calculator.worksheet._elmhurst_worksheet_000490 import ( ) -def _part(epc, identifier): # type: ignore[no-untyped-def] +def _part( + epc: EpcPropertyData, identifier: BuildingPartIdentifier +) -> SapBuildingPart: return next(p for p in epc.sap_building_parts if p.identifier is identifier) @@ -84,3 +91,19 @@ def test_age_band_override_re_dates_the_main_part_only() -> None: assert ( _part(result, BuildingPartIdentifier.EXTENSION_1).construction_age_band == "B" ) + + +@pytest.mark.parametrize( + "member", [m for m in ConstructionAgeBand if m is not ConstructionAgeBand.UNKNOWN] +) +def test_every_resolvable_age_band_value_decodes_to_an_overlay( + member: ConstructionAgeBand, +) -> None: + # A classifier emits a ConstructionAgeBand value; if the overlay can't decode + # it the override silently no-ops. Every non-UNKNOWN member must resolve. + + # Act + simulation = age_band_overlay_for(member.value, 0) + + # Assert + assert simulation is not None