mirror of
https://github.com/PaperMC/Paper.git
synced 2025-01-21 07:50:52 +01:00
SPIGOT-4818: Unit test banner patterns
By: md_5 <git@md-5.net>
This commit is contained in:
parent
a318ed1949
commit
a3c770141e
1 changed files with 33 additions and 0 deletions
|
@ -0,0 +1,33 @@
|
|||
package org.bukkit.block.banner;
|
||||
|
||||
import junit.framework.Assert;
|
||||
import net.minecraft.server.EnumBannerPatternType;
|
||||
import org.bukkit.support.AbstractTestingBase;
|
||||
import org.junit.Test;
|
||||
|
||||
public class PatternTypeTest extends AbstractTestingBase {
|
||||
|
||||
@Test
|
||||
public void testToBukkit() {
|
||||
for (EnumBannerPatternType nms : EnumBannerPatternType.values()) {
|
||||
PatternType bukkit = PatternType.getByIdentifier(nms.b());
|
||||
|
||||
Assert.assertNotNull("No Bukkit banner for " + nms + " " + nms.b(), bukkit);
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testToNMS() {
|
||||
for (PatternType bukkit : PatternType.values()) {
|
||||
EnumBannerPatternType found = null;
|
||||
for (EnumBannerPatternType nms : EnumBannerPatternType.values()) {
|
||||
if (bukkit.getIdentifier().equals(nms.b())) {
|
||||
found = nms;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
Assert.assertNotNull("No NMS banner for " + bukkit + " " + bukkit.getIdentifier(), found);
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Add table
Reference in a new issue