Search in sources :

Example 1 with Tag

use of gherkin.ast.Tag in project cucable-plugin by trivago.

the class GherkinToCucableConverterTest method convertGherkinExampleTableToCucableExampleMapTest.

@Test
public void convertGherkinExampleTableToCucableExampleMapTest() {
    Location location = new Location(1, 2);
    List<Tag> tags = new ArrayList<>();
    Tag tag = new Tag(location, "@tag");
    tags.add(tag);
    String keyword = "keyword";
    String name = "name";
    String description = "description";
    List<TableCell> headerCells = new ArrayList<>();
    headerCells.add(new TableCell(location, "headerCell1"));
    headerCells.add(new TableCell(location, "headerCell2"));
    headerCells.add(new TableCell(location, "headerCell3"));
    TableRow tableHeader = new TableRow(location, headerCells);
    List<TableRow> tableBody = new ArrayList<>();
    List<TableCell> bodyCells = new ArrayList<>();
    bodyCells.add(new TableCell(location, "bodyCell1"));
    bodyCells.add(new TableCell(location, "bodyCell2"));
    bodyCells.add(new TableCell(location, "bodyCell3"));
    tableBody.add(new TableRow(location, bodyCells));
    bodyCells = new ArrayList<>();
    bodyCells.add(new TableCell(location, "bodyCell4"));
    bodyCells.add(new TableCell(location, "bodyCell5"));
    bodyCells.add(new TableCell(location, "bodyCell6"));
    tableBody.add(new TableRow(location, bodyCells));
    Examples examples = new Examples(location, tags, keyword, name, description, tableHeader, tableBody);
    List<String> includeTags = new ArrayList<>();
    List<String> excludeTags = new ArrayList<>();
    Map<String, List<String>> table = gherkinToCucableConverter.convertGherkinExampleTableToCucableExampleMap(examples);
    assertThat(table.size(), is(3));
}
Also used : ArrayList(java.util.ArrayList) TableCell(gherkin.ast.TableCell) TableRow(gherkin.ast.TableRow) ArrayList(java.util.ArrayList) List(java.util.List) Tag(gherkin.ast.Tag) Examples(gherkin.ast.Examples) Location(gherkin.ast.Location) Test(org.junit.Test)

Aggregations

Examples (gherkin.ast.Examples)1 Location (gherkin.ast.Location)1 TableCell (gherkin.ast.TableCell)1 TableRow (gherkin.ast.TableRow)1 Tag (gherkin.ast.Tag)1 ArrayList (java.util.ArrayList)1 List (java.util.List)1 Test (org.junit.Test)1