CommonCore/testsrc/de/steamwar/command/CacheCommandTest.java

29 Zeilen
931 B
Java

2022-06-20 14:06:28 +02:00
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))));
}
}