Add support for parsing first slayer task (#6677)

Fixes #5945
This commit is contained in:
Michael
2018-11-25 05:08:24 -08:00
committed by Tomas Slusny
parent 654a7f76f1
commit 42542ddad9
2 changed files with 19 additions and 0 deletions

View File

@@ -56,6 +56,7 @@ import org.mockito.runners.MockitoJUnitRunner;
public class SlayerPluginTest
{
private static final String TASK_NEW = "Your new task is to kill 231 Suqahs.";
private static final String TASK_NEW_FIRST = "We'll start you off hunting goblins, you'll need to kill 17 of them.";
private static final String TASK_NEW_NPC_CONTACT = "Excellent, you're doing great. Your new task is to kill<br>211 Suqahs.";
private static final String TASK_NEW_FROM_PARTNER = "You have received a new Slayer assignment from breaklulz: Dust Devils (377)";
private static final String TASK_CHECKSLAYERGEM_WILDERNESS = "You're assigned to kill Suqahs in the Wilderness; only 211 more to go.";
@@ -146,6 +147,18 @@ public class SlayerPluginTest
assertEquals(231, slayerPlugin.getAmount());
}
@Test
public void testFirstTask()
{
Widget npcDialog = mock(Widget.class);
when(npcDialog.getText()).thenReturn(TASK_NEW_FIRST);
when(client.getWidget(WidgetInfo.DIALOG_NPC_TEXT)).thenReturn(npcDialog);
slayerPlugin.onGameTick(new GameTick());
assertEquals("goblins", slayerPlugin.getTaskName());
assertEquals(17, slayerPlugin.getAmount());
}
@Test
public void testNewNpcContactTask()
{