Closed
Description
Description
If constructor has a val property, codegen doesn't use this constructor but instead instantiates class via reflection although it can normally be done without it.
To Reproduce
Launch action on the following class:
class CustomClass(val x: Int) {
fun f(): Int {
return x
}
}
Expected behavior
Correct tests are generated, reflection is not used at all.
Actual behavior
Generated tests contain reflection usage.
Visual proofs (screenshots, logs, images)
One of the generated tests:
@Test
fun testF1() {
val customClass = (createInstance("CustomClass") as CustomClass)
setField(customClass, "CustomClass", "x", -255)
val actual = customClass.f()
assertEquals(-255, actual)
}
Metadata
Metadata
Assignees
Type
Projects
Status
Done