Search in sources :

Example 6 with Numeric

use of com.github.bordertech.wcomponents.autocomplete.type.Numeric in project wcomponents by BorderTech.

the class WNumberField_Test method testAddAutocompleteSectionAfterSettingWithSection.

@Test
public void testAddAutocompleteSectionAfterSettingWithSection() {
    WNumberField field = new WNumberField();
    String sectionName = "foo";
    String otherSection = "bar";
    String expected;
    for (Numeric number : Numeric.values()) {
        expected = AutocompleteUtil.getCombinedForSection(sectionName, AutocompleteUtil.getNamedSection(otherSection), number.getValue());
        field.setAutocomplete(number);
        field.addAutocompleteSection(otherSection);
        field.addAutocompleteSection(sectionName);
        Assert.assertEquals(expected, field.getAutocomplete());
    }
}
Also used : Numeric(com.github.bordertech.wcomponents.autocomplete.type.Numeric) Test(org.junit.Test)

Example 7 with Numeric

use of com.github.bordertech.wcomponents.autocomplete.type.Numeric in project wcomponents by BorderTech.

the class WSingleSelect_Test method testSetAutocompleteNumeric.

// with number field autocomplete
@Test
public void testSetAutocompleteNumeric() {
    WSingleSelect field = new WSingleSelect();
    for (Numeric number : Numeric.values()) {
        field.setAutocomplete(number);
        Assert.assertEquals(number.getValue(), field.getAutocomplete());
    }
}
Also used : Numeric(com.github.bordertech.wcomponents.autocomplete.type.Numeric) Test(org.junit.Test)

Aggregations

Numeric (com.github.bordertech.wcomponents.autocomplete.type.Numeric)7 Test (org.junit.Test)7 WNumberField (com.github.bordertech.wcomponents.WNumberField)1