assertThat(bounds.width).isEqualTo(BUTTON_WIDTH);
assertThat(bounds.height).isEqualTo(BUTTON_HEIGHT);
}
public void test_onCanvas_moveTo() throws Exception {
CanvasInfo canvas =
parseJavaInfo(
"public class Test extends Canvas {",
" public Test() {",
" {",
" Button button = new Button('My Button');",
" addChild(button);",
" button.moveTo(100, 50);",
" }",
" }",
"}");
canvas.refresh();
CanvasInfo button = getJavaInfoByName("button");
// check that location applied
Rectangle bounds = button.getBounds();
assertThat(bounds.x).isEqualTo(100);
assertThat(bounds.y).isEqualTo(50);
assertThat(bounds.width).isEqualTo(BUTTON_WIDTH);
assertThat(bounds.height).isEqualTo(BUTTON_HEIGHT);
}