Created
July 3, 2019 07:13
-
-
Save michael-simons/13b6f6b4504ee7e93d765ad7adb7715d to your computer and use it in GitHub Desktop.
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
import static org.assertj.core.api.Assertions.*; | |
import org.junit.jupiter.api.Test; | |
class EnumTests { | |
enum YourFriendlyEnumMostPeopleUse { | |
THING1, THING2 | |
} | |
enum YesEnumsCanBeMuchMore { | |
THING1, THING2 { | |
@Override | |
public void something() { | |
} | |
}; | |
void something() {} | |
} | |
@Test | |
void mindBlown() { | |
assertThat(YourFriendlyEnumMostPeopleUse.THING1.getClass().isEnum()).isTrue(); | |
assertThat(YesEnumsCanBeMuchMore.THING1.getClass().isEnum()).isTrue(); | |
assertThat(YesEnumsCanBeMuchMore.THING2.getClass().isEnum()).isFalse(); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment