Skip to content

Latest commit

 

History

History
25 lines (19 loc) · 976 Bytes

File metadata and controls

25 lines (19 loc) · 976 Bytes

####Code style

####Tests

  • Class naming: unit tests - {ClassUnderTest}UnitTest, persistence tests - {ClassUnderTest}PersistenceTest, integration tests - {ClassUnderTest}IntegrationTest
  • Method naming: [unitOfWork_stateUnderTest_expectedBehavior], read more...
  • Code layout: given-when-then pattern a.k.a. Arrange-Act-Assert
  • Assertions: Hamcrest library
@Test
 public void sum_simpleValues_calculated() {
     
   // given  
   Calculator calculator = new Calculator();

   // when 
   int sum = calculator.sum(1, 3);
   
   // then
   assertThat(sum, is(4));
 }