Differences

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

Link to this comparison view

Both sides previous revisionPrevious revision
student:junit:v3 [2018/08/14 13:32] bernstdhstudent:junit:v3 [2018/08/14 13:33] (current) bernstdh
Line 72: Line 72:
 In the "setup" portion, this method creates an ''%%Atom%%''   objects (for oxygen). It then calls the   ''%%Assert.assertEquals()%%'' method to tell jUnit to do some testing.   This particular version of the ''%%Assert.assertEquals()%%'' method is   passed three parameters and has the following syntax: In the "setup" portion, this method creates an ''%%Atom%%''   objects (for oxygen). It then calls the   ''%%Assert.assertEquals()%%'' method to tell jUnit to do some testing.   This particular version of the ''%%Assert.assertEquals()%%'' method is   passed three parameters and has the following syntax:
      
-|   Assert.assertEquals(//Description//, //ExpectedValue//, //ActualValue//);    | 
    
 |  Assert.assertEquals(//Description//, //ExpectedValue//, //ActualValue//);  | |  Assert.assertEquals(//Description//, //ExpectedValue//, //ActualValue//);  |
Line 121: Line 120:
 When using ''%%Assert.assertEquals()%%'' to compare floating point   numbers (e.g., ''%%double%%'' values), one must be careful. In   general, one should not use the ''%%==%%'' operator   with ''%%double%%'' values 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 be careful. In   general, one should not use the ''%%==%%'' operator   with ''%%double%%'' values 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//);  |