All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.nohope.test.EnumTestSupport Maven / Gradle / Ivy

There is a newer version: 0.2.3
Show newest version
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);
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy