src/test/java/org/thegalactic/context/constraint/categorical/CategoricalStorageTest.java
@Test
    public void testSet() {
        CategoricalModel model = CategoricalModel.create();
        CategoricalAttribute attribute = model.addAttribute();
        CategoricalValue value = attribute.addValue("Test");
        CategoricalStorage storage = CategoricalStorage.create(model);
        storage.set(value, false);
        assertEquals(false, storage.get(value));
        try {
            value = CategoricalModel.create().addAttribute().addValue("Test");
            storage.set(value, true);
            fail("An IllegalArgumentException must be thrown");
        } catch (IllegalArgumentException e) {
            assertEquals("The CategoricalValue is not in the model of the CategoricalStorage", e.getMessage());
        }
    }
/**
     * Test of set method, of class CategoricalStorage.
     */
Test of set method, of class CategoricalStorage.
Test of set method of class CategoricalStorage .
@Test
    public void testSet() {
        CategoricalModel model = CategoricalModel.create();
        CategoricalAttribute attribute = model.addAttribute();
        CategoricalValue value = attribute.addValue("Test");
        CategoricalStorage storage = CategoricalStorage.create(model);
        storage.set(value, false);
        assertEquals(false, storage.get(value));
        try {
            value = CategoricalModel.create().addAttribute().addValue("Test");
            storage.set(value, true);
            fail("An IllegalArgumentException must be thrown");
        } catch (IllegalArgumentException e) {
            assertEquals("The CategoricalValue is not in the model of the CategoricalStorage", e.getMessage());
        }
    }
@ Test public void testSet ( ) { CategoricalModel model = CategoricalModel . create ( ) ; CategoricalAttribute attribute = model . addAttribute ( ) ; CategoricalValue value = attribute . addValue ( "Test" ) ; CategoricalStorage storage = CategoricalStorage . create ( model ) ; storage . set ( value , false ) ; assertEquals ( false , storage . get ( value ) ) ; try { value = CategoricalModel . create ( ) . addAttribute ( ) . addValue ( "Test" ) ; storage . set ( value , true ) ; fail ( "An IllegalArgumentException must be thrown" ) ; } catch ( IllegalArgumentException e ) { assertEquals ( "The CategoricalValue is not in the model of the CategoricalStorage" , e . getMessage ( ) ) ; } }
Test of set method, of class CategoricalStorage.
Test of set method of class CategoricalStorage .