Java - Coder des tests unitaires

Comment rendre les tests unitaires plus faciles et plus complets

  • Use only method with comments
  • Use the more appropriate method
don't use : assertTrue(1, "xxx", o1.equals(o2)); => use assertEquals(1, "xxx", o1, o2); (With assertEquals : null value are also tested without exception !)


Article extrait du site Loribel.com.
https://loribel.com/java/normes/unitTest.html