feat: add Basic Test Environment

This commit is contained in:
Ruben 2024-11-19 16:21:42 +01:00
parent b30d4e97e5
commit 3a5324a718
3 changed files with 35 additions and 0 deletions

View File

@ -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>

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

View File

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