src/test/java/org/thegalactic/context/constraint/categorical/CategoricalAttributeTest.java
@Test
    public void testAddValue() {
        CategoricalModel model = CategoricalModel.create();
        CategoricalAttribute attribute = model.addAttribute();
        assertTrue(attribute.addValue("Test") instanceof CategoricalValue);
        try {
            model.instantiate();
            attribute.addValue("Test2");
            fail("An IllegalStateException must be thrown");
        } catch (IllegalStateException e) {
            assertEquals("The underlying model has already been instantiated", e.getMessage());
        }
    }
/**
     * Test of addValue method, of class CategoricalAttribute.
     */
Test of addValue method, of class CategoricalAttribute.
Test of addValue method of class CategoricalAttribute .
@Test
    public void testAddValue() {
        CategoricalModel model = CategoricalModel.create();
        CategoricalAttribute attribute = model.addAttribute();
        assertTrue(attribute.addValue("Test") instanceof CategoricalValue);
        try {
            model.instantiate();
            attribute.addValue("Test2");
            fail("An IllegalStateException must be thrown");
        } catch (IllegalStateException e) {
            assertEquals("The underlying model has already been instantiated", e.getMessage());
        }
    }
@ Test public void testAddValue ( ) { CategoricalModel model = CategoricalModel . create ( ) ; CategoricalAttribute attribute = model . addAttribute ( ) ; assertTrue ( attribute . addValue ( "Test" ) instanceof CategoricalValue ) ; try { model . instantiate ( ) ; attribute . addValue ( "Test2" ) ; fail ( "An IllegalStateException must be thrown" ) ; } catch ( IllegalStateException e ) { assertEquals ( "The underlying model has already been instantiated" , e . getMessage ( ) ) ; } }
Test of addValue method, of class CategoricalAttribute.
Test of addValue method of class CategoricalAttribute .