src/test/java/org/thegalactic/context/constraint/binary/BinaryStorageTest.java
@Test
    public void testIntersection() {
        BinaryStorage storage1 = BinaryStorage.create(10);
        BinaryStorage storage2 = BinaryStorage.create(10);
        storage1.set(0, true);
        storage2.set(0, true);
        storage1.set(1, true);
        storage2.set(1, false);
        storage1.set(2, false);
        storage2.set(2, true);
        storage1.set(3, false);
        storage2.set(3, false);
        assertEquals("[1000000000]", storage1.intersection(storage2).toString());
        assertEquals("[1010000000]", storage2.toString());
        try {
            storage2 = BinaryStorage.create(9);
            storage1.intersection(storage2);
            fail("An IllegalArgumentException must be thrown");
        } catch (IllegalArgumentException e) {
            assertEquals("BooleanStorage objects must have the same size", e.getMessage());
        }
    }
/**
     * Test of intersection method, of class BinaryStorage.
     */
Test of intersection method, of class BinaryStorage.
Test of intersection method of class BinaryStorage .
@Test
    public void testIntersection() {
        BinaryStorage storage1 = BinaryStorage.create(10);
        BinaryStorage storage2 = BinaryStorage.create(10);
        storage1.set(0, true);
        storage2.set(0, true);
        storage1.set(1, true);
        storage2.set(1, false);
        storage1.set(2, false);
        storage2.set(2, true);
        storage1.set(3, false);
        storage2.set(3, false);
        assertEquals("[1000000000]", storage1.intersection(storage2).toString());
        assertEquals("[1010000000]", storage2.toString());
        try {
            storage2 = BinaryStorage.create(9);
            storage1.intersection(storage2);
            fail("An IllegalArgumentException must be thrown");
        } catch (IllegalArgumentException e) {
            assertEquals("BooleanStorage objects must have the same size", e.getMessage());
        }
    }
@ Test public void testIntersection ( ) { BinaryStorage storage1 = BinaryStorage . create ( 10 ) ; BinaryStorage storage2 = BinaryStorage . create ( 10 ) ; storage1 . set ( 0 , true ) ; storage2 . set ( 0 , true ) ; storage1 . set ( 1 , true ) ; storage2 . set ( 1 , false ) ; storage1 . set ( 2 , false ) ; storage2 . set ( 2 , true ) ; storage1 . set ( 3 , false ) ; storage2 . set ( 3 , false ) ; assertEquals ( "[1000000000]" , storage1 . intersection ( storage2 ) . toString ( ) ) ; assertEquals ( "[1010000000]" , storage2 . toString ( ) ) ; try { storage2 = BinaryStorage . create ( 9 ) ; storage1 . intersection ( storage2 ) ; fail ( "An IllegalArgumentException must be thrown" ) ; } catch ( IllegalArgumentException e ) { assertEquals ( "BooleanStorage objects must have the same size" , e . getMessage ( ) ) ; } }
Test of intersection method, of class BinaryStorage.
Test of intersection method of class BinaryStorage .