Skip to content

Commit

Permalink
Added a test
Browse files Browse the repository at this point in the history
  • Loading branch information
amandelpie committed Oct 21, 2022
1 parent 3be20f3 commit a9bbba9
Show file tree
Hide file tree
Showing 2 changed files with 44 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
public class UnsafeWithField {
Field field;

Field setField(Field f) {
public Field setField(Field f) {
field = f;
return Field.INTEGER;
}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
package examples.unsafe

import examples.CustomJavaDocTagsEnabler
import examples.SummaryTestCaseGeneratorTest
import org.junit.jupiter.api.Test
import org.junit.jupiter.api.extension.ExtendWith
import org.utbot.examples.unsafe.UnsafeWithField
import org.utbot.framework.plugin.api.MockStrategyApi
import org.utbot.tests.infrastructure.DoNotCalculate

@ExtendWith(CustomJavaDocTagsEnabler::class)
class UnsafeWithFieldTest : SummaryTestCaseGeneratorTest(
UnsafeWithField::class
) {
@Test
fun testUnsafeWithField() {
val summary1 = "@utbot.classUnderTest {@link UnsafeWithField}\n" +
"@utbot.methodUnderTest {@link org.utbot.examples.unsafe.UnsafeWithField#setField(java.text.NumberFormat.Field)}\n" +
"@utbot.returnsFrom {@code return Field.INTEGER;}"

val methodName1 = "testSetField_ReturnFieldINTEGER"

val displayName1 = "-> return Field.INTEGER"

val summaryKeys = listOf(
summary1
)

val displayNames = listOf(
displayName1
)

val methodNames = listOf(
methodName1
)

val method = UnsafeWithField::setField
val mockStrategy = MockStrategyApi.NO_MOCKS
val coverage = DoNotCalculate

summaryCheck(method, mockStrategy, coverage, summaryKeys, methodNames, displayNames)
}
}

0 comments on commit a9bbba9

Please sign in to comment.