{
List<IMenuItemInfo> itemObjects = menuObject.getItems();
assertThat(itemObjects).hasSize(2);
// "Sub" item
{
IMenuItemInfo itemObject = itemObjects.get(0);
assertSame(item_1, itemObject.getModel());
// presentation
{
// items don't have screen shot, we show them on menu shots
assertNull(itemObject.getImage());
// reasonable bounds
{
Rectangle bounds = itemObject.getBounds();
assertThat(bounds.x).isEqualTo(2);
assertThat(bounds.y).isEqualTo(2);
assertThat(bounds.width).isGreaterThan(30);
assertThat(bounds.height).isGreaterThan(20);
}
}
// sub-menu
{
IMenuInfo subMenuObject = itemObject.getMenu();
assertSame(subMenu, subMenuObject.getModel());
// access
assertFalse(subMenuObject.isHorizontal());
{
List<IMenuItemInfo> subMenuItemObjects = subMenuObject.getItems();
assertThat(subMenuItemObjects).hasSize(2);
assertSame(subMenuItem_1, subMenuItemObjects.get(0).getModel());
assertSame(subMenuItem_2, subMenuItemObjects.get(1).getModel());
}
// presentation
assertNotNull(subMenuObject.getImage());
{
Rectangle bounds = subMenuObject.getBounds();
assertThat(bounds.width).isGreaterThan(85);
assertThat(bounds.height).isGreaterThan(45);
}
}
}
// "Separate item"
{
IMenuItemInfo itemObject = itemObjects.get(1);
assertSame(item_2, itemObject.getModel());
// no sub-menu
assertNull(itemObject.getMenu());
// no policy
assertSame(IMenuPolicy.NOOP, itemObject.getPolicy());
}
}
}
}