petr pavlovich wrote:Hello people!
Do I do it?
Tell me, please.
Are there any errors?
I do not understand what your class is trying to do. What is the resault of the test? I suspect it fails as this is the last line of the junit code.
As a broad statement, I don't think the JUnit test is valid but I do not know what "valid' really is.
What does the RtriangleProvider do? It looks like it returns various points. The only thing you can test for RTriangle, per se, is that the points are returned as expected (assertEquals would be one JUnit statement to consider). I suggest RtriangleProvider implement the RTriangle interface and should also have a constructor accepting the points and that you use that constructor instead of a static getRTriangle method.
From there I am not really sure what to say. If you are trying to confirm whether or not the triangle is a right triangle, then to me it would made sense to have an "isRightTriangle" method returning a boolean or something like that coded on the interface that your class implements. Your test(s) would then be able to feed sets of data points in and the test would assert that isRightTriangle is true or false as appropriate based on the points provided.
Joined: Jul 10, 2011
test method for testing getRtriangle that he really returns a right triangle
Joined: Jun 30, 2003
Check your classpath. Based on the error, it appears the JUnit jar is not defined properly in the classpath.