Search in sources :

Example 1 with Numeric

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

the class WNumberField_Test method testSetAutocomplete.

@Test
public void testSetAutocomplete() {
    WNumberField field = new WNumberField();
    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)

Example 2 with Numeric

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

the class WDropdown_Test method testSetAutocompleteNumeric.

// with number field autocomplete
@Test
public void testSetAutocompleteNumeric() {
    WDropdown field = new WDropdown();
    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)

Example 3 with Numeric

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

the class WTextField_Test method testSetAutocompleteNumeric.

// with number field autocomplete
@Test
public void testSetAutocompleteNumeric() {
    WTextField field = new WTextField();
    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)

Example 4 with Numeric

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

the class WNumberFieldRenderer_Test method testSetAutocomplete.

@Test
public void testSetAutocomplete() throws IOException, SAXException, XpathException {
    WNumberField field = new WNumberField();
    for (Numeric number : Numeric.values()) {
        field.setAutocomplete(number);
        assertSchemaMatch(field);
        assertXpathEvaluatesTo(number.getValue(), "//ui:numberfield/@autocomplete", field);
    }
}
Also used : Numeric(com.github.bordertech.wcomponents.autocomplete.type.Numeric) WNumberField(com.github.bordertech.wcomponents.WNumberField) Test(org.junit.Test)

Example 5 with Numeric

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

the class WNumberField_Test method testAddAutocompleteSectionAfterSetting.

@Test
public void testAddAutocompleteSectionAfterSetting() {
    WNumberField field = new WNumberField();
    String sectionName = "foo";
    String expected;
    for (Numeric number : Numeric.values()) {
        expected = AutocompleteUtil.getCombinedForSection(sectionName, number.getValue());
        field.setAutocomplete(number);
        field.addAutocompleteSection(sectionName);
        Assert.assertEquals(expected, 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