2012-09-26 16:34:06 -05:00
|
|
|
package org.bukkit;
|
|
|
|
|
2019-04-23 14:54:36 +10:00
|
|
|
import static org.hamcrest.Matchers.*;
|
|
|
|
import static org.junit.Assert.*;
|
2018-08-26 12:00:00 +10:00
|
|
|
import net.minecraft.server.IRegistry;
|
2016-03-01 08:32:46 +11:00
|
|
|
import net.minecraft.server.MinecraftKey;
|
2012-09-26 16:34:06 -05:00
|
|
|
import org.bukkit.craftbukkit.CraftSound;
|
2018-08-26 20:44:50 +10:00
|
|
|
import org.bukkit.support.AbstractTestingBase;
|
2012-09-26 16:34:06 -05:00
|
|
|
import org.junit.Test;
|
|
|
|
|
2018-08-26 20:44:50 +10:00
|
|
|
public class SoundTest extends AbstractTestingBase {
|
2012-09-26 16:34:06 -05:00
|
|
|
|
|
|
|
@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() {
|
2018-08-26 12:00:00 +10:00
|
|
|
for (MinecraftKey effect : IRegistry.SOUND_EVENT.keySet()) {
|
2017-05-14 12:00:00 +10:00
|
|
|
assertNotNull(effect + "", Sound.valueOf(effect.getKey().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
|
|
|
}
|