feat: add Basic Test Environment
This commit is contained in:
parent
b30d4e97e5
commit
3a5324a718
@ -20,6 +20,12 @@
|
||||
<artifactId>antlr4</artifactId>
|
||||
<version>4.11.1</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.junit.jupiter</groupId>
|
||||
<artifactId>junit-jupiter</artifactId>
|
||||
<version>5.10.0</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>commons-io</groupId>
|
||||
<artifactId>commons-io</artifactId>
|
||||
|
15
LanguageServer/src/test/java/CodeSnippetOptionsTest.java
Normal file
15
LanguageServer/src/test/java/CodeSnippetOptionsTest.java
Normal file
@ -0,0 +1,15 @@
|
||||
|
||||
import de.dhbw.helper.CodeSnippetOptions;
|
||||
import de.dhbw.model.SnippetWithName;
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
import static org.junit.jupiter.api.Assertions.assertEquals;
|
||||
|
||||
public class CodeSnippetOptionsTest {
|
||||
@Test
|
||||
public void testForLoop() {
|
||||
CodeSnippetOptions options = new CodeSnippetOptions();
|
||||
|
||||
assertEquals(options.getForLoopSnippet().getSnippet(),"for(i = 0; i < ${1:listSize}; i++){\n\n}");
|
||||
}
|
||||
}
|
@ -0,0 +1,14 @@
|
||||
import de.dhbw.JavaTXTextDocumentService;
|
||||
import de.dhbw.helper.CodeSnippetOptions;
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
import static org.junit.jupiter.api.Assertions.assertEquals;
|
||||
|
||||
public class JavaTXLanguageDocumentServiceTest {
|
||||
@Test
|
||||
public void testWordExtraction() {
|
||||
JavaTXTextDocumentService service = new JavaTXTextDocumentService();
|
||||
|
||||
assertEquals(service.getWordOfLineAndCharacter(0,0, "test"),"test");
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user