src/test/java/org/thegalactic/context/constraint/categorical/CategoricalStorageTest.java
@Test
    public void testToString() {
        CategoricalModel model = CategoricalModel.create();
        CategoricalAttribute attribute = model.addAttribute();
        CategoricalValue value1 = attribute.addValue("Test1");
        CategoricalValue value2 = attribute.addValue("Test2");
        CategoricalValue value3 = attribute.addValue("Test3");
        CategoricalStorage storage = CategoricalStorage.create(model);
        assertEquals("[[Test1, Test2, Test3]]", storage.toString());
        storage.set(value1, false);
        assertEquals("[[Test2, Test3]]", storage.toString());
        storage.set(value2, false);
        assertEquals("[[Test3]]", storage.toString());
        storage.set(value3, false);
        assertEquals("[[]]", storage.toString());

        model = CategoricalModel.create();
        CategoricalAttribute attribute1 = model.addAttribute();
        value1 = attribute1.addValue("Test1");
        attribute1.addValue("Test2");
        attribute1.addValue("Test3");
        CategoricalAttribute attribute2 = model.addAttribute();
        CategoricalValue value4 = attribute2.addValue("Test4");
        attribute2.addValue("Test5");
        storage = CategoricalStorage.create(model);
        assertEquals("[[Test1, Test2, Test3], [Test4, Test5]]", storage.toString());
        storage.set(value1, false);
        storage.set(value4, false);
        assertEquals("[[Test2, Test3], [Test5]]", storage.toString());
    }
/**
     * Test of toString method, of class CategoricalStorage.
     */
Test of toString method, of class CategoricalStorage.
Test of toString method of class CategoricalStorage .
@Test
    public void testToString() {
        CategoricalModel model = CategoricalModel.create();
        CategoricalAttribute attribute = model.addAttribute();
        CategoricalValue value1 = attribute.addValue("Test1");
        CategoricalValue value2 = attribute.addValue("Test2");
        CategoricalValue value3 = attribute.addValue("Test3");
        CategoricalStorage storage = CategoricalStorage.create(model);
        assertEquals("[[Test1, Test2, Test3]]", storage.toString());
        storage.set(value1, false);
        assertEquals("[[Test2, Test3]]", storage.toString());
        storage.set(value2, false);
        assertEquals("[[Test3]]", storage.toString());
        storage.set(value3, false);
        assertEquals("[[]]", storage.toString());
        model = CategoricalModel.create();
        CategoricalAttribute attribute1 = model.addAttribute();
        value1 = attribute1.addValue("Test1");
        attribute1.addValue("Test2");
        attribute1.addValue("Test3");
        CategoricalAttribute attribute2 = model.addAttribute();
        CategoricalValue value4 = attribute2.addValue("Test4");
        attribute2.addValue("Test5");
        storage = CategoricalStorage.create(model);
        assertEquals("[[Test1, Test2, Test3], [Test4, Test5]]", storage.toString());
        storage.set(value1, false);
        storage.set(value4, false);
        assertEquals("[[Test2, Test3], [Test5]]", storage.toString());
    }
@ Test public void testToString ( ) { CategoricalModel model = CategoricalModel . create ( ) ; CategoricalAttribute attribute = model . addAttribute ( ) ; CategoricalValue value1 = attribute . addValue ( "Test1" ) ; CategoricalValue value2 = attribute . addValue ( "Test2" ) ; CategoricalValue value3 = attribute . addValue ( "Test3" ) ; CategoricalStorage storage = CategoricalStorage . create ( model ) ; assertEquals ( "[[Test1, Test2, Test3]]" , storage . toString ( ) ) ; storage . set ( value1 , false ) ; assertEquals ( "[[Test2, Test3]]" , storage . toString ( ) ) ; storage . set ( value2 , false ) ; assertEquals ( "[[Test3]]" , storage . toString ( ) ) ; storage . set ( value3 , false ) ; assertEquals ( "[[]]" , storage . toString ( ) ) ; model = CategoricalModel . create ( ) ; CategoricalAttribute attribute1 = model . addAttribute ( ) ; value1 = attribute1 . addValue ( "Test1" ) ; attribute1 . addValue ( "Test2" ) ; attribute1 . addValue ( "Test3" ) ; CategoricalAttribute attribute2 = model . addAttribute ( ) ; CategoricalValue value4 = attribute2 . addValue ( "Test4" ) ; attribute2 . addValue ( "Test5" ) ; storage = CategoricalStorage . create ( model ) ; assertEquals ( "[[Test1, Test2, Test3], [Test4, Test5]]" , storage . toString ( ) ) ; storage . set ( value1 , false ) ; storage . set ( value4 , false ) ; assertEquals ( "[[Test2, Test3], [Test5]]" , storage . toString ( ) ) ; }
Test of toString method, of class CategoricalStorage.
Test of toString method of class CategoricalStorage .