Skip to content

Commit 562cf66

Browse files
authored
Merge pull request #141 from jacz24/main
Added Make tests
2 parents 4f84b0e + 1ca3eee commit 562cf66

File tree

8 files changed

+59
-4
lines changed

8 files changed

+59
-4
lines changed

tests/001.simba

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
(*
22
## Inventory Tests
3-
Tests the integrety of several inventory methods.
3+
Tests the integrity of several inventory methods.
44
*)
55
{$DEFINE WL_TEST}
66
{$I WaspLib/osrs.simba}
@@ -25,7 +25,6 @@ begin
2525
Assert(Inventory.IsOpen());
2626
Assert(Inventory.Slots.Count() = 11);
2727
Assert(Inventory.Slots.CountEmpty() = 17);
28-
Assert(Inventory.Slots.CountEmpty() = 17);
2928
Assert(Inventory.Items.Contains('Air rune'));
3029
Assert(Inventory.Items.Contains('Super attack(4)'));
3130
Assert(Inventory.Slots.ReadStack(2) = 1);

tests/002.simba

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
(*
22
# Login Tests
3-
Tests the integrety of several login methods.
3+
Tests the integrity of several login methods.
44
*)
55
{$DEFINE WL_TEST}
66
{$I WaspLib/osrs.simba}

tests/003.simba

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
(*
22
## Bank Tests
3-
Tests the integrety of several bankpin and bank methods.
3+
Tests the integrity of several bankpin and bank methods.
44
*)
55
{$DEFINE WL_TEST}
66
{$I WaspLib/osrs.simba}

tests/004.simba

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
(*
2+
## Make Tests
3+
Tests the integrity of several Make 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 004.png - Basic Make interface with 5 items, 6 quantity buttons, 6 selected
20+
img := new TImage(PATH + mode + FILENAME + '.png');
21+
Target.SetImage(img);
22+
WaspLibSetup();
23+
24+
Assert(Make.IsOpen());
25+
Assert(Length(Make.GetItemBoxes()) = 5);
26+
27+
Assert(Length(Make.GetQuantityBoxes()) = 6);
28+
Assert(Length(Make.FindQuantityButtons) = 6);
29+
Assert(Make.GetCurrentQuantity() = 6);
30+
Assert(Make.HasHint() = False);
31+
32+
// Test 004-1.png - Make interface with hint tooltip showing
33+
img := new TImage(PATH + mode + FILENAME + '-1.png');
34+
Target.SetImage(img);
35+
36+
WaspLibSetup();
37+
38+
Assert(Make.IsOpen());
39+
Assert(Make.HasHint());
40+
Assert(Make.ReadHint().Contains('Willow longbow'));
41+
Assert(Length(Make.GetItemBoxes()) = 5);
42+
43+
// Test 004-2.png - Different Make interface with 1 item, 3 quantity buttons
44+
img := new TImage(PATH + mode + FILENAME + '-2.png');
45+
Target.SetImage(img);
46+
47+
WaspLibSetup();
48+
49+
Assert(Make.IsOpen());
50+
Assert(Length(Make.GetItemBoxes()) = 1);
51+
Assert(Length(Make.GetQuantityBoxes()) = 3);
52+
Assert(Length(Make.FindQuantityButtons) = 3);
53+
Assert(Make.GetCurrentQuantity() = 10);
54+
Assert(Make.HasHint() = False);
55+
end;
56+
end;

tests/imgs/fixed/001.png

164 KB
Loading
247 KB
Loading
280 KB
Loading
255 KB
Loading

0 commit comments

Comments
 (0)