Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions exercises/practice/dnd-character/.meta/tests.toml
Original file line number Diff line number Diff line change
Expand Up @@ -70,3 +70,4 @@ include = false
[dca2b2ec-f729-4551-84b9-078876bb4808]
description = "each ability is only calculated once"
reimplements = "2ca77b9b-c099-46c3-a02c-0d0f68ffa0fe"
include = false
10 changes: 0 additions & 10 deletions exercises/practice/dnd-character/TestCases.pas
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ DndCharacterTest = class(TTestCase)
procedure ability_modifier_for_score_18_is_plus_4;
procedure random_ability_is_within_range;
procedure random_character_is_valid;
procedure each_ability_is_only_calculated_once;
end;

implementation
Expand Down Expand Up @@ -149,15 +148,6 @@ procedure DndCharacterTest.random_character_is_valid;
TapAssertTrue(Self, 'random character is valid', true, (FCharacter.strength >= 3) and (FCharacter.strength <= 18) and (FCharacter.dexterity >= 3) and (FCharacter.dexterity <= 18) and (FCharacter.constitution >= 3) and (FCharacter.constitution <= 18) and (FCharacter.intelligence >= 3) and (FCharacter.intelligence <= 18) and (FCharacter.wisdom >= 3) and (FCharacter.wisdom <= 18) and (FCharacter.charisma >= 3) and (FCharacter.charisma <= 18) and (FCharacter.hitpoints = 10 + DndCharacter.modifier(FCharacter.constitution)));
end;

// dca2b2ec-f729-4551-84b9-078876bb4808
procedure DndCharacterTest.each_ability_is_only_calculated_once;
var
LCharacter : TCharacter;
begin
LCharacter := DndCharacter.character;
TapAssertTrue(Self, 'each ability is only calculated once', true, (LCharacter.strength = FCharacter.strength) and (LCharacter.dexterity = FCharacter.dexterity) and (LCharacter.constitution = FCharacter.constitution) and (LCharacter.intelligence = FCharacter.intelligence) and (LCharacter.wisdom = FCharacter.wisdom) and (LCharacter.charisma = FCharacter.charisma) );
end;

initialization
RegisterTest(DndCharacterTest);

Expand Down