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?
10 Replies
⌛
This post has been reserved for your question.
Hey @mjstx! Please useTIP: Narrow down your issue to simple and precise questions to maximize the chance that others will reply in here./close
or theClose 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.
any help appreciated
the formula is the area of a circle
Unknown User•2y ago
Message Not Public
Sign In & Join Server To View
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•2y ago
Message Not Public
Sign In & Join Server To View
ohh ok, although we havent learned about throw just yet, but thanks 👍
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•2y ago
Message Not Public
Sign In & Join Server To View
sure will, thanks
Post Closed
This post has been closed by <@290070433984806912>.