builder:RuleParentTest: added
This commit is contained in:
parent
c73a23f838
commit
b414a8e602
1 changed files with 33 additions and 0 deletions
|
@ -0,0 +1,33 @@
|
||||||
|
package net.kemitix.checkstyle.ruleset.builder;
|
||||||
|
|
||||||
|
import lombok.val;
|
||||||
|
import org.junit.Test;
|
||||||
|
|
||||||
|
import java.util.Arrays;
|
||||||
|
|
||||||
|
import static org.assertj.core.api.Assertions.assertThat;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Tests for {@link RuleParent}.
|
||||||
|
*
|
||||||
|
* @author Paul Campbell (pcampbell@kemitix.net)
|
||||||
|
*/
|
||||||
|
public class RuleParentTest {
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void valueOf() throws Exception {
|
||||||
|
assertThat(RuleParent.valueOf("CHECKER")).isEqualTo(RuleParent.CHECKER);
|
||||||
|
assertThat(RuleParent.valueOf("TREEWALKER")).isEqualTo(RuleParent.TREEWALKER);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void values() throws Exception {
|
||||||
|
//given
|
||||||
|
val expected = Arrays.asList("CHECKER", "TREEWALKER");
|
||||||
|
//when
|
||||||
|
val values = Arrays.stream(RuleParent.values())
|
||||||
|
.map(RuleParent::toString);
|
||||||
|
//then
|
||||||
|
assertThat(values).containsExactlyElementsOf(expected);
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in a new issue