chat commands: Add test case for PB without trailing period

This commit is contained in:
Jordan Atwood
2019-01-29 17:26:06 -08:00
committed by Tomas Slusny
parent 14cd865d07
commit b559fd859b

View File

@@ -147,6 +147,23 @@ public class ChatCommandsPluginTest
verify(configManager).setConfiguration(eq("personalbest.adam"), eq("kree'arra"), eq(79));
}
@Test
public void testPersonalBestNoTrailingPeriod()
{
final String FIGHT_DURATION = "Fight duration: <col=ff0000>0:59</col>. Personal best: 0:55";
when(client.getUsername()).thenReturn("Adam");
// This sets lastBoss
ChatMessage chatMessage = new ChatMessage(SERVER, "", "Your Zulrah kill count is: <col=ff0000>4</col>.", null);
chatCommandsPlugin.onChatMessage(chatMessage);
chatMessage = new ChatMessage(SERVER, "", FIGHT_DURATION, null);
chatCommandsPlugin.onChatMessage(chatMessage);
verify(configManager).setConfiguration(eq("personalbest.adam"), eq("zulrah"), eq(55));
}
@Test
public void testNewPersonalBest()
{