29 Zeilen
931 B
Java
29 Zeilen
931 B
Java
|
package de.steamwar.command;
|
||
|
|
||
|
import org.hamcrest.Matchers;
|
||
|
import org.junit.Test;
|
||
|
|
||
|
import java.util.List;
|
||
|
|
||
|
import static org.hamcrest.MatcherAssert.assertThat;
|
||
|
import static org.hamcrest.Matchers.*;
|
||
|
|
||
|
public class CacheCommandTest {
|
||
|
|
||
|
@Test
|
||
|
public void testCaching() {
|
||
|
CacheCommand cmd = new CacheCommand();
|
||
|
List<String> tabCompletions1 = cmd.tabComplete("test", "", new String[]{""});
|
||
|
List<String> tabCompletions2 = cmd.tabComplete("test", "", new String[]{""});
|
||
|
assertThat(tabCompletions1, is(equalTo(tabCompletions2)));
|
||
|
}
|
||
|
|
||
|
@Test
|
||
|
public void testCachingWithDifferentSenders() {
|
||
|
CacheCommand cmd = new CacheCommand();
|
||
|
List<String> tabCompletions1 = cmd.tabComplete("test", "", new String[]{""});
|
||
|
List<String> tabCompletions2 = cmd.tabComplete("test2", "", new String[]{""});
|
||
|
assertThat(tabCompletions1, is(not(equalTo(tabCompletions2))));
|
||
|
}
|
||
|
}
|