PageSection pageSection = sections.get(0);
List<ConditionalBlock> blocks = pageSection.getConditionalBlocks();
assertThat(blocks.size(), is(1));
ConditionalBlock block = blocks.get(0);
List<ConditionalBlockStatement> statements = block.getStatements();
assertThat(statements.size(), is(3));
{
ConditionalBlockStatement statement = statements.get(0);
assertThat(statement.isInverted(), is(false));
List<ObjectSpecs> statementObjects = statement.getObjects();
assertThat(statementObjects.size(), is(1));
assertThat(statementObjects.get(0).getObjectName(), is("button-1"));
assertThat(statementObjects.get(0).getSpecs().get(0).getOriginalText(), is("width: > 100px"));
}
{
ConditionalBlockStatement statement = statements.get(1);
assertThat(statement.isInverted(), is(false));
List<ObjectSpecs> statementObjects = statement.getObjects();
assertThat(statementObjects.size(), is(1));
assertThat(statementObjects.get(0).getObjectName(), is("button-2"));
assertThat(statementObjects.get(0).getSpecs().get(0).getOriginalText(), is("width: 200px"));
}
{
ConditionalBlockStatement statement = statements.get(2);
assertThat(statement.isInverted(), is(false));
List<ObjectSpecs> statementObjects = statement.getObjects();
assertThat(statementObjects.size(), is(1));
assertThat(statementObjects.get(0).getObjectName(), is("button-3"));
assertThat(statementObjects.get(0).getSpecs().get(0).getOriginalText(), is("width: 200px"));
}
List<ObjectSpecs> bodyObjects = block.getBodyObjects();
assertThat(bodyObjects.size(), is(2));
assertThat(bodyObjects.get(0).getObjectName(), is("button-1"));
assertThat(bodyObjects.get(0).getSpecs().get(0).getOriginalText(), is("text is: sample text"));
assertThat(bodyObjects.get(1).getObjectName(), is("button-2"));
assertThat(bodyObjects.get(1).getSpecs().get(0).getOriginalText(), is("text ends: something"));