diff --git a/tests/001.simba b/tests/001.simba index 040ef5f9..27c14649 100644 --- a/tests/001.simba +++ b/tests/001.simba @@ -1,6 +1,6 @@ (* ## Inventory Tests -Tests the integrety of several inventory methods. +Tests the integrity of several inventory methods. *) {$DEFINE WL_TEST} {$I WaspLib/osrs.simba} @@ -25,7 +25,6 @@ begin Assert(Inventory.IsOpen()); Assert(Inventory.Slots.Count() = 11); Assert(Inventory.Slots.CountEmpty() = 17); - Assert(Inventory.Slots.CountEmpty() = 17); Assert(Inventory.Items.Contains('Air rune')); Assert(Inventory.Items.Contains('Super attack(4)')); Assert(Inventory.Slots.ReadStack(2) = 1); diff --git a/tests/002.simba b/tests/002.simba index 167b9ab8..33cf4a36 100644 --- a/tests/002.simba +++ b/tests/002.simba @@ -1,6 +1,6 @@ (* # Login Tests -Tests the integrety of several login methods. +Tests the integrity of several login methods. *) {$DEFINE WL_TEST} {$I WaspLib/osrs.simba} diff --git a/tests/003.simba b/tests/003.simba index 35f11321..eeb3e02b 100644 --- a/tests/003.simba +++ b/tests/003.simba @@ -1,6 +1,6 @@ (* ## Bank Tests -Tests the integrety of several bankpin and bank methods. +Tests the integrity of several bankpin and bank methods. *) {$DEFINE WL_TEST} {$I WaspLib/osrs.simba} diff --git a/tests/004.simba b/tests/004.simba new file mode 100644 index 00000000..5ef41b1c --- /dev/null +++ b/tests/004.simba @@ -0,0 +1,56 @@ +(* +## Make Tests +Tests the integrity of several Make interface methods. +*) +{$DEFINE WL_TEST} +{$I WaspLib/osrs.simba} +{$ASSERTIONS ON} + +const + PATH: String = {$MACRO DIR} + 'imgs' + PATH_SEP; + MODES: TStringArray = ['fixed', 'resizable_classic', 'resizable_modern_small', 'resizable_modern_large']; + FILENAME: String := PATH_SEP + PathExtractNameWithoutExt(SCRIPT_FILE); +var + mode: String; + img: TImage; +begin + for mode in MODES do + begin + // Test 004.png - Basic Make interface with 5 items, 6 quantity buttons, 6 selected + img := new TImage(PATH + mode + FILENAME + '.png'); + Target.SetImage(img); + WaspLibSetup(); + + Assert(Make.IsOpen()); + Assert(Length(Make.GetItemBoxes()) = 5); + + Assert(Length(Make.GetQuantityBoxes()) = 6); + Assert(Length(Make.FindQuantityButtons) = 6); + Assert(Make.GetCurrentQuantity() = 6); + Assert(Make.HasHint() = False); + + // Test 004-1.png - Make interface with hint tooltip showing + img := new TImage(PATH + mode + FILENAME + '-1.png'); + Target.SetImage(img); + + WaspLibSetup(); + + Assert(Make.IsOpen()); + Assert(Make.HasHint()); + Assert(Make.ReadHint().Contains('Willow longbow')); + Assert(Length(Make.GetItemBoxes()) = 5); + + // Test 004-2.png - Different Make interface with 1 item, 3 quantity buttons + img := new TImage(PATH + mode + FILENAME + '-2.png'); + Target.SetImage(img); + + WaspLibSetup(); + + Assert(Make.IsOpen()); + Assert(Length(Make.GetItemBoxes()) = 1); + Assert(Length(Make.GetQuantityBoxes()) = 3); + Assert(Length(Make.FindQuantityButtons) = 3); + Assert(Make.GetCurrentQuantity() = 10); + Assert(Make.HasHint() = False); + end; +end; diff --git a/tests/imgs/fixed/001.png b/tests/imgs/fixed/001.png index 5b51b249..b437d8b2 100644 Binary files a/tests/imgs/fixed/001.png and b/tests/imgs/fixed/001.png differ diff --git a/tests/imgs/resizable_classic/001.png b/tests/imgs/resizable_classic/001.png index 5e21c114..3021ae83 100644 Binary files a/tests/imgs/resizable_classic/001.png and b/tests/imgs/resizable_classic/001.png differ diff --git a/tests/imgs/resizable_modern_large/001.png b/tests/imgs/resizable_modern_large/001.png index 9722d8d8..ad953aed 100644 Binary files a/tests/imgs/resizable_modern_large/001.png and b/tests/imgs/resizable_modern_large/001.png differ diff --git a/tests/imgs/resizable_modern_small/001.png b/tests/imgs/resizable_modern_small/001.png index 88a7a259..be88c6b0 100644 Binary files a/tests/imgs/resizable_modern_small/001.png and b/tests/imgs/resizable_modern_small/001.png differ