Opened 8 years ago
Closed 8 years ago
#379 closed defect (fixed)
Fix validation of requirements to check for unit
Reported by: | ibboard | Owned by: | |
---|---|---|---|
Priority: | critical | Milestone: | WarFoundry API 0.2 |
Component: | WarFoundry-API | Version: | Trunk |
Keywords: | requirement army validation | Cc: | |
Blocked By: | Blocking: |
Description
Before #350, the first two unit requirements have been written and have unit tests, but the tests are making assumptions that mean they don't test for the correct stand-alone behaviour.
Currently, an "army valid" test that has a "must not have more than X of unit type A" requirement from a unit type B that is in the race but not in the army would result in a failed test, even though it should be NotApplicable because unit type B isn't in the army.
Change History (31)
comment:1 Changed 8 years ago by
Status: | new → confirmed |
---|
comment:2 Changed 8 years ago by
comment:3 Changed 8 years ago by
comment:4 Changed 8 years ago by
comment:5 Changed 8 years ago by
comment:6 Changed 8 years ago by
comment:7 Changed 8 years ago by
comment:8 Changed 8 years ago by
comment:9 Changed 8 years ago by
comment:10 Changed 8 years ago by
comment:11 Changed 8 years ago by
Todo:
- RequiresNUnitsForMUnitsRequirement renamed to UnitRequiresNUnitsForMUnits to match existing pattern
- Extract common RequiresNUnitsForMObjectsRequirement
- Give Unit... requirements their own ID (currently got parent type's static value cascading through)
- Make better use of IsApplicable, which is in abstract class but is currently ignored in most requirements
comment:12 Changed 8 years ago by
comment:13 Changed 8 years ago by
comment:14 Changed 8 years ago by
comment:15 Changed 8 years ago by
comment:16 Changed 8 years ago by
comment:17 Changed 8 years ago by
comment:18 Changed 8 years ago by
comment:19 Changed 8 years ago by
comment:20 Changed 8 years ago by
comment:21 Changed 8 years ago by
comment:22 Changed 8 years ago by
comment:23 Changed 8 years ago by
comment:24 Changed 8 years ago by
comment:25 Changed 8 years ago by
comment:26 Changed 8 years ago by
comment:27 Changed 8 years ago by
comment:28 Changed 8 years ago by
comment:29 Changed 8 years ago by
comment:30 Changed 8 years ago by
comment:31 Changed 8 years ago by
Resolution: | → fixed |
---|---|
Status: | confirmed → closed |
Now completed (unless anyone complains it is broken).
Note: See
TracTickets for help on using
tickets.
While working on #350, I realised that this was partly by design (albeit a slightly bad design). The existing requirements were meant as generic requirements that could be used on anything (not just units). The factories then tied them to unit types. The behaviour still needs correcting, but the design should keep the existing requirements as generic (or make them abstract) and create unit-specific versions.