Search in sources :

Example 1 with ParameterControl

use of com.yandex.money.api.model.showcase.components.uicontrols.ParameterControl in project yandex-money-sdk-java by yandex-money.

the class ShowcaseParserTest method checkOptions.

private void checkOptions(List<Select.Option> options) {
    assertEquals(options.size(), 3);
    Select.Option option = options.get(0);
    assertEquals(option.label, "label1");
    assertEquals(option.value, "value1");
    assertNull(option.group);
    option = options.get(1);
    assertEquals(option.label, "label2");
    assertEquals(option.value, "value2");
    assertNull(option.group);
    option = options.get(2);
    assertEquals(option.label, "label3");
    assertEquals(option.value, "value3");
    Group group = option.group;
    assertNotNull(group);
    List<Component> items = group.items;
    assertEquals(items.size(), 1);
    Component component = items.get(0);
    assertTrue(component instanceof Text);
    ParameterControl control = (ParameterControl) component;
    assertEquals(control.name, "name14");
    assertEquals(control.getValue(), "readonly");
    assertEquals(control.hint, "hint");
    assertEquals(control.label, "label");
    assertEquals(control.alert, "alert");
    assertFalse(control.required);
    assertTrue(control.readonly);
}
Also used : Group(com.yandex.money.api.model.showcase.components.containers.Group) Select(com.yandex.money.api.model.showcase.components.uicontrols.Select) ParameterControl(com.yandex.money.api.model.showcase.components.uicontrols.ParameterControl) Text(com.yandex.money.api.model.showcase.components.uicontrols.Text) Component(com.yandex.money.api.model.showcase.components.Component)

Example 2 with ParameterControl

use of com.yandex.money.api.model.showcase.components.uicontrols.ParameterControl in project yandex-money-sdk-java by yandex-money.

the class ShowcaseParserTest method checkComponentFields.

private void checkComponentFields(Component component, String name, String value) {
    assertTrue(component instanceof ParameterControl);
    ParameterControl control = (ParameterControl) component;
    assertEquals(control.name, name);
    assertEquals(control.getValue(), value);
    assertEquals(control.hint, "hint");
    assertEquals(control.label, "label");
    assertEquals(control.alert, "alert");
    assertTrue(control.required);
    assertFalse(control.readonly);
}
Also used : ParameterControl(com.yandex.money.api.model.showcase.components.uicontrols.ParameterControl)

Aggregations

ParameterControl (com.yandex.money.api.model.showcase.components.uicontrols.ParameterControl)2 Component (com.yandex.money.api.model.showcase.components.Component)1 Group (com.yandex.money.api.model.showcase.components.containers.Group)1 Select (com.yandex.money.api.model.showcase.components.uicontrols.Select)1 Text (com.yandex.money.api.model.showcase.components.uicontrols.Text)1