Add more test cases for SimpleAliasRegistry
Closes gh-26982
This commit is contained in:
parent
ad63a534cb
commit
345d8186d4
|
|
@ -60,4 +60,28 @@ class SimpleAliasRegistryTests {
|
|||
assertThat(registry.hasAlias("real_name", "alias_c")).isTrue();
|
||||
}
|
||||
|
||||
@Test
|
||||
void removeAliasTest() {
|
||||
SimpleAliasRegistry registry = new SimpleAliasRegistry();
|
||||
registry.registerAlias("realname", "nickname");
|
||||
assertThat(registry.hasAlias("realname", "nickname")).isTrue();
|
||||
|
||||
registry.removeAlias("nickname");
|
||||
assertThat(registry.hasAlias("realname", "nickname")).isFalse();
|
||||
}
|
||||
|
||||
@Test
|
||||
void isAliasTest() {
|
||||
SimpleAliasRegistry registry = new SimpleAliasRegistry();
|
||||
registry.registerAlias("realname", "nickname");
|
||||
assertThat(registry.isAlias("nickname")).isTrue();
|
||||
assertThat(registry.isAlias("fake")).isFalse();
|
||||
}
|
||||
|
||||
@Test
|
||||
void getAliasesTest() {
|
||||
SimpleAliasRegistry registry = new SimpleAliasRegistry();
|
||||
registry.registerAlias("realname", "nickname");
|
||||
assertThat(registry.getAliases("realname"));
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue