Skip to content

Commit

Permalink
test: fix tests for undertest code
Browse files Browse the repository at this point in the history
  • Loading branch information
phodal committed Dec 24, 2023
1 parent ac1e894 commit fca8755
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,12 @@ fun CodeContainer.buildSourceCode(codeLines: List<String>) {

ds.Content = CodeDataStructUtil.contentByPosition(codeLines, ds.Position)
ds.Functions.map {
// in Chapi, the position of function is not correct, so we need to fix it
val position = it.Position
if (it.Annotations.isNotEmpty()) {
position.StartLine -= 1
position.StartLinePosition = 0
}
it.Content = CodeDataStructUtil.contentByPosition(codeLines, it.Position)
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ public class CompanyService {
assertEquals(3, result.size)
val typedTestIns = result[1] as BasicTestIns
typedTestIns.testType shouldBe TestCodeBuilderType.METHOD_UNIT
// typedTestIns.generatedCode shouldContain "@Test"
// typedTestIns.underTestCode.length shouldNotBe 0
typedTestIns.generatedCode shouldContain "@Test"
typedTestIns.underTestCode shouldContain "companyMongoRepository.findAll()"
}
}

0 comments on commit fca8755

Please sign in to comment.