Java Code Examples for net.runelite.api.ChatMessageType#ITEM_EXAMINE

The following examples show how to use net.runelite.api.ChatMessageType#ITEM_EXAMINE . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: ExaminePluginTest.java    From plugins with GNU General Public License v3.0 6 votes vote down vote up
@Test
public void testItem()
{
	when(client.getWidget(anyInt(), anyInt())).thenReturn(mock(Widget.class));
	when(itemManager.getItemDefinition(anyInt())).thenReturn(mock(ItemDefinition.class));

	MenuOptionClicked menuOptionClicked = new MenuOptionClicked(
		"Examine",
		"Something",
		ItemID.ABYSSAL_WHIP,
		MenuOpcode.EXAMINE_ITEM.getId(),
		123,
		456,
		false
	);
	examinePlugin.onMenuOptionClicked(menuOptionClicked);

	ChatMessage chatMessage = new ChatMessage(null, ChatMessageType.ITEM_EXAMINE, "", "A weapon from the abyss.", "", 0);
	examinePlugin.onChatMessage(chatMessage);

	// This passes due to not mocking the ItemDefinition for the whip
	verify(examineClient).submitItem(anyInt(), anyString());
}
 
Example 2
Source File: ExaminePluginTest.java    From plugins with GNU General Public License v3.0 6 votes vote down vote up
@Test
public void testLargeStacks()
{
	when(client.getWidget(anyInt(), anyInt())).thenReturn(mock(Widget.class));
	when(itemManager.getItemDefinition(anyInt())).thenReturn(mock(ItemDefinition.class));

	MenuOptionClicked menuOptionClicked = new MenuOptionClicked(
		"Examine",
		"Something",
		ItemID.ABYSSAL_WHIP,
		MenuOpcode.EXAMINE_ITEM.getId(),
		123,
		456,
		false
	);

	examinePlugin.onMenuOptionClicked(menuOptionClicked);

	ChatMessage chatMessage = new ChatMessage(null, ChatMessageType.ITEM_EXAMINE, "", "100000 x Abyssal whip", "", 0);
	examinePlugin.onChatMessage(chatMessage);

	verify(examineClient, never()).submitItem(anyInt(), anyString());
}
 
Example 3
Source File: ExaminePluginTest.java    From runelite with BSD 2-Clause "Simplified" License 6 votes vote down vote up
@Test
public void testItem()
{
	when(client.getWidget(anyInt(), anyInt())).thenReturn(mock(Widget.class));
	when(itemManager.getItemComposition(anyInt())).thenReturn(mock(ItemComposition.class));

	MenuOptionClicked menuOptionClicked = new MenuOptionClicked();
	menuOptionClicked.setMenuOption("Examine");
	menuOptionClicked.setMenuAction(MenuAction.EXAMINE_ITEM);
	menuOptionClicked.setId(ItemID.ABYSSAL_WHIP);
	examinePlugin.onMenuOptionClicked(menuOptionClicked);

	ChatMessage chatMessage = new ChatMessage(null, ChatMessageType.ITEM_EXAMINE, "", "A weapon from the abyss.", "", 0);
	examinePlugin.onChatMessage(chatMessage);

	// This passes due to not mocking the ItemComposition for the whip
	verify(examineClient).submitItem(anyInt(), anyString());
}
 
Example 4
Source File: ExaminePluginTest.java    From runelite with BSD 2-Clause "Simplified" License 6 votes vote down vote up
@Test
public void testLargeStacks()
{
	when(client.getWidget(anyInt(), anyInt())).thenReturn(mock(Widget.class));
	when(itemManager.getItemComposition(anyInt())).thenReturn(mock(ItemComposition.class));

	MenuOptionClicked menuOptionClicked = new MenuOptionClicked();
	menuOptionClicked.setMenuOption("Examine");
	menuOptionClicked.setMenuAction(MenuAction.EXAMINE_ITEM);
	menuOptionClicked.setId(ItemID.ABYSSAL_WHIP);
	examinePlugin.onMenuOptionClicked(menuOptionClicked);

	ChatMessage chatMessage = new ChatMessage(null, ChatMessageType.ITEM_EXAMINE, "", "100000 x Abyssal whip", "", 0);
	examinePlugin.onChatMessage(chatMessage);

	verify(examineClient, never()).submitItem(anyInt(), anyString());
}