You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Unnecessary reflection used for val properties that can be set via constructor #1190
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:
classCustomClass(valx:Int) {
funf(): 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
funtestF1() {
val customClass = (createInstance("CustomClass") asCustomClass)
setField(customClass, "CustomClass", "x", -255)
val actual = customClass.f()
assertEquals(-255, actual)
}
Activity
Construct assemble models for classes with val-properties in construc…