CommonCore/testsrc/de/steamwar/command/CacheCommandTest.java
yoyosource 75f88d65ac
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful
Fix stuff
Add tests
2022-06-20 14:06:28 +02:00

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))));
}
}