Package libshapedraw.shape

Examples of libshapedraw.shape.MockShape


        assertFalse(LibShapeDraw.getVersion().isEmpty());
    }

    @Test
    public void testUnregister() {
        MockShape counter = new MockShape();
        lib.addShape(counter);
        renderCheck(true, counter, false);

        assertTrue(lib.unregister());
View Full Code Here


    // ----------------------------------------------------------------------

    @Test
    public void testShapesAdd() {
        assertEquals(0, lib.getShapes().size());
        lib.addShape(new MockShape());
        assertEquals(1, lib.getShapes().size());
        lib.addShape(new MockShape());
        assertEquals(2, lib.getShapes().size());
        lib.addShape(new MockShape()).addShape(new MockShape()); // method chaining
        assertEquals(4, lib.getShapes().size());
        render(false);
    }
View Full Code Here

        lib.addShape(null);
    }

    @Test(expected=UnsupportedOperationException.class)
    public void testShapesUnmodifiable() {
        lib.getShapes().add(new MockShape());
    }
View Full Code Here

        lib.getShapes().add(new MockShape());
    }

    @Test
    public void testShapesAddDupe() {
        MockShape dupe = new MockShape();
        lib.addShape(dupe);
        assertEquals(1, lib.getShapes().size());
        lib.addShape(dupe);
        assertEquals(1, lib.getShapes().size());
    }
View Full Code Here

        assertEquals(1, lib.getShapes().size());
    }

    @Test
    public void testShapesRemoveClear() {
        MockShape shape0 = new MockShape();
        MockShape shape1 = new MockShape();
        MockShape shape2 = new MockShape();
        MockShape shape3 = new MockShape();
        lib.addShape(shape0).addShape(shape1).addShape(shape2).addShape(shape3);
        assertEquals(4, lib.getShapes().size());

        lib.removeShape(shape0);
        assertEquals(3, lib.getShapes().size());

        lib.removeShape(shape0);
        assertEquals(3, lib.getShapes().size());
        lib.removeShape(new MockShape());
        assertEquals(3, lib.getShapes().size());
        lib.removeShape(null);
        assertEquals(3, lib.getShapes().size());

        lib.removeShape(shape1).removeShape(shape2);
View Full Code Here

        assertEquals(0, lib.getShapes().size());
    }

    @Test
    public void testShapesRemoveInvalid() {
        MockShape shape = new MockShape();
        assertFalse(lib.getShapes().contains(shape));
        lib.removeShape(shape); // allowed no-op

        lib.removeShape(null); // also allowed
    }
View Full Code Here

        assertFalse(lib.isVisibleWhenHidingGui());
    }

    @Test
    public void testVisibleRender() {
        MockShape counter = new MockShape();
        lib.addShape(counter);

        lib.setVisible(false);
        lib.setVisibleWhenHidingGui(false);
        renderCheck(false, counter, false);
View Full Code Here

TOP

Related Classes of libshapedraw.shape.MockShape

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.