org.nohope.test.EnumTestSupport Maven / Gradle / Ivy
package org.nohope.test;
import org.junit.Test;
/**
* @author Ketoth Xupack
* @since 2012-01-28 18:31
*/
public abstract class EnumTestSupport> {
/** Tests whatever all enum constructors are private. */
@Test
public final void testEnumConstructor() {
EnumUtils.assertEnumConstructor(getEnumClass());
}
/** @return class which constructor should be tested. */
protected abstract Class getEnumClass();
/**
* Geek check for calling {@code values()} and {@code valueOf(String)}
* on constructor.
*/
@Test
public final void basic() {
EnumUtils.basicAssertions(getEnumClass());
}
/**
* Routine for testing logic which depends on enum order logic.
*
* @param values expected order of enums
*/
@SafeVarargs
protected final void assertOrder(final E... values) {
EnumUtils.assertOrder(getEnumClass(), values);
}
}