Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
Next revisionBoth sides next revision
student:junit:v4 [2018/08/10 14:25] bernstdhstudent:junit:v4 [2018/08/14 10:11] bernstdh
Line 1: Line 1:
  
  
-===== JUnit Basics =====+===== JUnit v4 Basics =====
  
  
Line 8: Line 8:
  
  
-JUnit is an open-source testing framework. It provides a way to write,   organize, and run repeatable test.+JUnit is an open-source testing framework. It provides a way to write,   organize, and run repeatable test. This page provides a brief introduction to v4. Information is also available about  
 +[[student:junit:v5 | version 5 (Jupiter) ]].
  
  
Line 135: Line 136:
 When using ''%%Assert.assertEquals()%%'' to compare floating   point numbers (e.g., ''%%double%%'' values), one must remember   that the ''%%==%%'' operator must be used with care   because of the less-than-perfect precision of operations   on ''%%double%%'' values.  In JUnit, the implication of this is   that one should check to see if ''%%double%%'' values are   within a tolerance value of each other.  Hence, when   comparing ''%%double%%'' values one should use the following: When using ''%%Assert.assertEquals()%%'' to compare floating   point numbers (e.g., ''%%double%%'' values), one must remember   that the ''%%==%%'' operator must be used with care   because of the less-than-perfect precision of operations   on ''%%double%%'' values.  In JUnit, the implication of this is   that one should check to see if ''%%double%%'' values are   within a tolerance value of each other.  Hence, when   comparing ''%%double%%'' values one should use the following:
  
-Assert.assertEquals(//Description//, //ExpectedValue//, //ActualValue//, //tolerance//);+''Assert.assertEquals(//Description//, //ExpectedValue//, //ActualValue//, //tolerance//);''