use of com.qcadoo.view.internal.internal.ViewDefinitionStateImpl in project qcadoo by qcadoo.
the class ViewDefinitionStateTest method shouldPerformEventOnState.
@Test
public void shouldPerformEventOnState() throws Exception {
// given
ViewDefinitionStateImpl viewDefinitionState = new ViewDefinitionStateImpl();
ContainerState state1 = mock(ContainerState.class);
given(state1.getName()).willReturn("name1");
InternalComponentState state2 = mock(InternalComponentState.class);
viewDefinitionState.addChild(state1);
given(state1.getChild("name2")).willReturn(state2);
// when
viewDefinitionState.performEvent("name1.name2", "event", new String[] { "arg1", "arg2" });
// then
Mockito.verify(state2).performEvent(viewDefinitionState, "event", "arg1", "arg2");
}
Aggregations