2012-09-26 16:34:06 -05:00
|
|
|
package org.bukkit;
|
|
|
|
|
2016-03-01 08:32:46 +11:00
|
|
|
import net.minecraft.server.MinecraftKey;
|
|
|
|
import net.minecraft.server.SoundEffect;
|
|
|
|
|
2012-12-14 02:02:02 -06:00
|
|
|
import static org.junit.Assert.*;
|
|
|
|
import static org.hamcrest.Matchers.*;
|
2012-09-26 16:34:06 -05:00
|
|
|
|
|
|
|
import org.bukkit.craftbukkit.CraftSound;
|
|
|
|
import org.junit.Test;
|
|
|
|
|
|
|
|
public class SoundTest {
|
|
|
|
|
|
|
|
@Test
|
|
|
|
public void testGetSound() {
|
|
|
|
for (Sound sound : Sound.values()) {
|
2012-12-14 02:02:02 -06:00
|
|
|
assertThat(sound.name(), CraftSound.getSound(sound), is(not(nullValue())));
|
2012-09-26 16:34:06 -05:00
|
|
|
}
|
|
|
|
}
|
2016-03-01 08:32:46 +11:00
|
|
|
|
|
|
|
@Test
|
|
|
|
public void testReverse() {
|
|
|
|
for (MinecraftKey effect : SoundEffect.a.keySet()) {
|
2016-06-26 19:32:05 +10:00
|
|
|
assertNotNull(effect + "", Sound.valueOf(effect.a().replace('.', '_').toUpperCase(java.util.Locale.ENGLISH)));
|
2016-03-01 08:32:46 +11:00
|
|
|
}
|
|
|
|
}
|
2016-11-19 14:27:18 +11:00
|
|
|
|
|
|
|
@Test
|
|
|
|
public void testCategory() {
|
|
|
|
for (SoundCategory category : SoundCategory.values()) {
|
|
|
|
assertNotNull(category + "", net.minecraft.server.SoundCategory.valueOf(category.name()));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
@Test
|
|
|
|
public void testCategoryReverse() {
|
|
|
|
for (net.minecraft.server.SoundCategory category : net.minecraft.server.SoundCategory.values()) {
|
|
|
|
assertNotNull(category + "", SoundCategory.valueOf(category.name()));
|
|
|
|
}
|
|
|
|
}
|
2012-09-26 16:34:06 -05:00
|
|
|
}
|