-
Notifications
You must be signed in to change notification settings - Fork 30
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
10a3de1
commit bb1ed47
Showing
3 changed files
with
63 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
54 changes: 54 additions & 0 deletions
54
src/main/java/de/oliver/fancynpcs/tests/impl/api/skin/SkinFetcherTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
package de.oliver.fancynpcs.tests.impl.api.skin; | ||
|
||
import de.oliver.fancynpcs.api.skins.SkinData; | ||
import de.oliver.fancynpcs.skins.SkinFetcherImpl; | ||
import de.oliver.fancynpcs.tests.annotations.FNBeforeEach; | ||
import de.oliver.fancynpcs.tests.annotations.FNTest; | ||
import org.bukkit.entity.Player; | ||
|
||
public class SkinFetcherTest { | ||
|
||
private SkinFetcherImpl skinFetcher; | ||
|
||
@FNBeforeEach | ||
public void setUp(Player player) { | ||
skinFetcher = new SkinFetcherImpl(); | ||
} | ||
|
||
@FNTest(name = "Test fetch skin by UUID") | ||
public void testSkinByUUID(Player player) { | ||
SkinData skin = skinFetcher.getByUUID(player.getUniqueId()); | ||
|
||
assert skin != null; | ||
assert skin.identifier().equals(player.getUniqueId().toString()); | ||
assert skin.type().equals(SkinData.SkinType.UUID); | ||
assert skin.variant().equals(SkinData.SkinVariant.DEFAULT); | ||
assert skin.textureValue() != null && !skin.textureValue().isEmpty(); | ||
assert skin.textureSignature() != null && !skin.textureSignature().isEmpty(); | ||
} | ||
|
||
@FNTest(name = "Test fetch skin by username") | ||
public void testSkinByUsername(Player player) { | ||
SkinData skin = skinFetcher.getByUsername(player.getName()); | ||
|
||
assert skin != null; | ||
assert skin.identifier().equals(player.getName()); | ||
assert skin.type().equals(SkinData.SkinType.USERNAME); | ||
assert skin.variant().equals(SkinData.SkinVariant.DEFAULT); | ||
assert skin.textureValue() != null && !skin.textureValue().isEmpty(); | ||
assert skin.textureSignature() != null && !skin.textureSignature().isEmpty(); | ||
} | ||
|
||
@FNTest(name = "Test fetch skin by URL") | ||
public void testSkinByURL(Player player) { | ||
SkinData skin = skinFetcher.getByURL("https://s.namemc.com/i/de7d8a3ffd1f584c.png"); | ||
|
||
assert skin != null; | ||
assert skin.identifier().equals("https://s.namemc.com/i/de7d8a3ffd1f584c.png"); | ||
assert skin.type().equals(SkinData.SkinType.URL); | ||
assert skin.variant().equals(SkinData.SkinVariant.DEFAULT); | ||
assert skin.textureValue() != null && !skin.textureValue().isEmpty(); | ||
assert skin.textureSignature() != null && !skin.textureSignature().isEmpty(); | ||
} | ||
|
||
} |