Junit test calling upon variable from a different class's method

Im creating a junit test for this formula and i wanted to include a test that checks if the r (the radius of the circle is) is greater than 0. I know you can use asserttrue(r>0), but how would i call upon the variable in the test method though?
No description
10 Replies
JavaBot
JavaBot2y ago
This post has been reserved for your question.
Hey @mjstx! Please use /close or the Close Post button above when you're finished. Please remember to follow the help guidelines. This post will be automatically closed after 300 minutes of inactivity.
TIP: Narrow down your issue to simple and precise questions to maximize the chance that others will reply in here.
mjstx
mjstxOP2y ago
any help appreciated the formula is the area of a circle
Unknown User
Unknown User2y ago
Message Not Public
Sign In & Join Server To View
mjstx
mjstxOP2y ago
ohh, ok so you basically already define rs range in the method and then use the test for making sure the output is fine
Unknown User
Unknown User2y ago
Message Not Public
Sign In & Join Server To View
mjstx
mjstxOP2y ago
ohh ok, although we havent learned about throw just yet, but thanks 👍
JavaBot
JavaBot2y ago
If you are finished with your post, please close it. If you are not, please ignore this message. Note that you will not be able to send further messages here after this post have been closed but you will be able to create new posts.
Unknown User
Unknown User2y ago
Message Not Public
Sign In & Join Server To View
mjstx
mjstxOP2y ago
sure will, thanks
JavaBot
JavaBot2y ago
Post Closed
This post has been closed by <@290070433984806912>.
Want results from more Discord servers?
Add your server