Test formatting

Use the --output-comments=<value> argument to select basic formatting options for tests written by Cover CLI (define the use of the // Arrange, // Act, and // Assert sections and comments).

Usage: --output-comments=<value>

Example: --output-comments=false

Default: true

Brief

Using --output-comments=false, Cover CLI will create tests in a more condensed format - the // Arrange, // Act, and // Assert comments are removed and the sections are inlined:

  @Test
  public void testHasItem() {
    assertFalse((new Order()).hasItem());
  }

Standard

Using --output-comments=true (or not specifying the argument at all), the Arrange, Act, and Assert sections will be labelled, but may still be combined together by inlining if they're small, for example:

@Test
public void testHasItem() throws Exception {
  // Arrange and Act
  boolean actual = (new Order()).hasItem();

  // Assert
  assertEquals(false, actual);
}

Last updated