-
Notifications
You must be signed in to change notification settings - Fork 46
Add unit tests for builders #543 #734
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's a good question, should we test private methods or not, I suggest to use reflection or change the visibility of a few methods to the package-private or internal and test private methods without mockito but after moving from Soot to JCDB
If you wish, you could play with changing visibility at this PR for 1-2 method for the SimpleNameBuilder
Please add a few tests if possible, fix the broken test and fix the issue with the mockito verision
} | ||
|
||
@Test | ||
fun `throws throwable if execution result is null`() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This test fails on my side with
expected: <<pre>
Test throws Throwable
</pre>> but was: < >
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i didn't expect these two builders have different behavior, but now we know. I fixed test
utbot-summary/src/test/kotlin/org/utbot/summary/comment/SimpleClusterCommentBuilderTest.kt
Show resolved
Hide resolved
utbot-summary/src/test/kotlin/org/utbot/summary/comment/SimpleCommentBuilderTest.kt
Show resolved
Hide resolved
@onewhl LGTM for me |
Description
Added unit tests for SimpleNameBuilder, SimpleCommentBuilder, SimpleClusterCommentBuilder.
Unfortunately, most of the methods are private and kotlin properties not always could be mocked, so the number of tests is small.
Fixes #543
Type of Change
Please delete options that are not relevant.
How Has This Been Tested?
Automated Testing
Run tests in PR.
Checklist (remove irrelevant options):
This is the author self-check list