Skip to content

Commit 50f4c88

Browse files
committed
Merge branch 'pr/144'
2 parents 38ae51d + 117cf59 commit 50f4c88

File tree

5 files changed

+49
-0
lines changed

5 files changed

+49
-0
lines changed

tests/005.simba

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
(*
2+
## DepositBox Tests
3+
Tests the integrity of several DepositBox interface methods.
4+
*)
5+
{$DEFINE WL_TEST}
6+
{$I WaspLib/osrs.simba}
7+
{$ASSERTIONS ON}
8+
9+
const
10+
PATH: String = {$MACRO DIR} + 'imgs' + PATH_SEP;
11+
MODES: TStringArray = ['fixed', 'resizable_classic', 'resizable_modern_small', 'resizable_modern_large'];
12+
FILENAME: String := PATH_SEP + PathExtractNameWithoutExt(SCRIPT_FILE);
13+
var
14+
mode: String;
15+
img: TImage;
16+
begin
17+
for mode in MODES do
18+
begin
19+
// Test 005.png - DepositBox interface open with items
20+
img := new TImage(PATH + mode + FILENAME + '.png');
21+
Target.SetImage(img);
22+
WaspLibSetup();
23+
24+
Assert(DepositBox.IsOpen());
25+
(*
26+
Assert(DepositBox.Equipment.Contains('Smiths gloves (i)'));
27+
Assert(DepositBox.Equipment.Contains('Graceful hood'));
28+
Assert(DepositBox.Equipment.Contains('Smithing cape(t)'));
29+
Assert(DepositBox.Equipment.Contains('Smiths tunic'));
30+
Assert(DepositBox.Equipment.Contains('Smiths trousers'));
31+
Assert(DepositBox.Equipment.Contains('Smiths boots'));
32+
*)
33+
34+
// Test slots - should have 28 slot boxes
35+
Assert(Length(DepositBox.InvSlotBoxes) = 28);
36+
37+
// Test equipment slots - should have 11 slot boxes
38+
Assert(Length(DepositBox.EquipSlotBoxes) = 11);
39+
40+
// Test quantity buttons - should have 5 buttons (ONE, FIVE, TEN, CUSTOM, ALL)
41+
Assert(Length(DepositBox.QuantityButtons) = 5);
42+
43+
// Test deposit buttons - should have 3 buttons (WORN, LOOT, INVENTORY)
44+
Assert(Length(DepositBox.DepositButtons) = 3);
45+
46+
// Test that ISlots can count items in deposit box
47+
Assert(DepositBox.ISlots.Count() > 0);
48+
end;
49+
end;

tests/imgs/fixed/005.png

202 KB
Loading
191 KB
Loading
276 KB
Loading
187 KB
Loading

0 commit comments

Comments
 (0)