-
Notifications
You must be signed in to change notification settings - Fork 109
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Тест на TestRunnerAdapter и расчет тестов средствами bsl ls
- Loading branch information
Showing
2 changed files
with
39 additions
and
0 deletions.
There are no files selected for viewing
33 changes: 33 additions & 0 deletions
33
...com/github/_1c_syntax/bsl/languageserver/codelenses/testrunner/TestRunnerAdapterTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
package com.github._1c_syntax.bsl.languageserver.codelenses.testrunner; | ||
|
||
import com.github._1c_syntax.bsl.languageserver.configuration.LanguageServerConfiguration; | ||
import com.github._1c_syntax.bsl.languageserver.util.TestUtils; | ||
import org.junit.jupiter.api.Test; | ||
import org.springframework.beans.factory.annotation.Autowired; | ||
import org.springframework.boot.test.context.SpringBootTest; | ||
|
||
import static org.assertj.core.api.Assertions.assertThat; | ||
|
||
@SpringBootTest | ||
class TestRunnerAdapterTest { | ||
|
||
@Autowired | ||
private TestRunnerAdapter testRunnerAdapter; | ||
|
||
@Autowired | ||
private LanguageServerConfiguration configuration; | ||
|
||
@Test | ||
void whenComputeTestsByLanguageServer_thenContainsTests() { | ||
// given | ||
var documentContext = TestUtils.getDocumentContextFromFile("src/test/resources/codelenses/testrunner/TestRunnerAdapter.os"); | ||
configuration.getCodeLensOptions().getTestRunnerAdapterOptions().setGetTestsByTestRunner(false); | ||
|
||
// when | ||
var testIds = testRunnerAdapter.getTestIds(documentContext); | ||
|
||
// then | ||
assertThat(testIds).hasSize(1); | ||
assertThat(testIds.get(0)).isEqualTo("Тест1"); | ||
} | ||
} |
6 changes: 6 additions & 0 deletions
6
src/test/resources/codelenses/testrunner/TestRunnerAdapter.os
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
&Тест | ||
Процедура Тест1() Экспорт | ||
КонецПроцедуры | ||
|
||
Процедура НеТест1() Экспорт | ||
КонецПроцедуры |