use of com.alessiodp.parties.common.addons.internal.PartiesPlaceholder in project Parties by AlessioDP.
the class PartiesPlaceholderTest method testMembers.
@Test
public void testMembers() {
Messages.PARTIES_LIST_EMPTY = "empty";
Messages.PARTIES_LIST_ONLINEFORMAT = "player";
Messages.PARTIES_LIST_OFFLINEFORMAT = "offlineplayer";
Messages.PARTIES_LIST_SEPARATOR = ",";
when(mockMessageUtils.convertPlaceholders(any(), any(), any())).then(args -> args.getArgument(0));
PartiesPlaceholder placeholder = PartiesPlaceholder.getPlaceholder("members");
assertEquals(PartiesPlaceholder.MEMBERS, placeholder);
assertEquals(Messages.PARTIES_LIST_OFFLINEFORMAT + Messages.PARTIES_LIST_SEPARATOR + Messages.PARTIES_LIST_OFFLINEFORMAT, placeholder.formatPlaceholder(player1, party1, "members"));
}
use of com.alessiodp.parties.common.addons.internal.PartiesPlaceholder in project Parties by AlessioDP.
the class PartiesPlaceholderTest method testPlaceholderLeaderUuid.
@Test
public void testPlaceholderLeaderUuid() {
PartiesPlaceholder placeholder = PartiesPlaceholder.getPlaceholder("leader_uuid");
assertEquals(PartiesPlaceholder.LEADER_UUID, placeholder);
assertEquals(player1.getPlayerUUID().toString(), placeholder.formatPlaceholder(player1, party1, "leader_uuid"));
}
use of com.alessiodp.parties.common.addons.internal.PartiesPlaceholder in project Parties by AlessioDP.
the class PartiesPlaceholderTest method testMembersTotal.
@Test
public void testMembersTotal() {
PartiesPlaceholder placeholder = PartiesPlaceholder.getPlaceholder("members_total");
assertEquals(PartiesPlaceholder.MEMBERS_TOTAL, placeholder);
assertEquals("2", placeholder.formatPlaceholder(player1, party1, "members_total"));
placeholder = PartiesPlaceholder.getPlaceholder("members_online_total");
assertEquals(PartiesPlaceholder.MEMBERS_ONLINE_TOTAL, placeholder);
assertEquals("0", placeholder.formatPlaceholder(player1, party1, "members_online_total"));
placeholder = PartiesPlaceholder.getPlaceholder("members_offline_total");
assertEquals(PartiesPlaceholder.MEMBERS_OFFLINE_TOTAL, placeholder);
assertEquals("2", placeholder.formatPlaceholder(player1, party1, "members_offline_total"));
}
use of com.alessiodp.parties.common.addons.internal.PartiesPlaceholder in project Parties by AlessioDP.
the class PartiesPlaceholderTest method testPlaceholderColorName.
@Test
public void testPlaceholderColorName() {
PartiesPlaceholder placeholder = PartiesPlaceholder.getPlaceholder("color_name");
assertEquals(PartiesPlaceholder.COLOR_NAME, placeholder);
assertEquals("", placeholder.formatPlaceholder(player1, party1, "color_name"));
party1.setAccessible(true);
party1.setColor(new PartyColorImpl("red", "123", "&c", 0, 0, 0));
party1.setAccessible(false);
assertEquals(party1.getColor().getName(), placeholder.formatPlaceholder(player1, party1, "color_name"));
}
use of com.alessiodp.parties.common.addons.internal.PartiesPlaceholder in project Parties by AlessioDP.
the class PartiesPlaceholderTest method testPlaceholderListPartiesTotal.
@Test
public void testPlaceholderListPartiesTotal() {
when(mockDatabaseManager.getListPartiesNumber()).thenReturn(3);
PartiesPlaceholder placeholder = PartiesPlaceholder.getPlaceholder("list_parties_total");
assertEquals(PartiesPlaceholder.LIST_PARTIES_TOTAL, placeholder);
assertEquals("3", placeholder.formatPlaceholder(player1, party1, "list_parties_total"));
}
Aggregations