Test - Given When Then

Table of Contents

1 - About

Structure of an unit test

Then when phase is called setting a fixture.

2 - Java - Junit

/**
  * The name should be transformed into uppercase.
  */
@Test
public void shouldReturnItemNameInUpperCase() {
 
    //
    // Given
    //
    String name = "Nicolas"
 
    //
    // When
    //
    String result = name.toUppercase();
 
    //
    // Then
    //
    assertEqual(result, "NICOLAS");
}
code/test/given-when-then.txt ยท Last modified: 2017/11/03 09:50 by gerardnico