Package org.jmock

Examples of org.jmock.Constraint.eval()


    }

    public void testIsNull() {
        Constraint p = new IsNull();

        assertTrue(p.eval(null));
        assertTrue(!p.eval(new Object()));
    }

    public void testIsSame() {
        Object o1 = new Object();
View Full Code Here


    public void testIsNull() {
        Constraint p = new IsNull();

        assertTrue(p.eval(null));
        assertTrue(!p.eval(new Object()));
    }

    public void testIsSame() {
        Object o1 = new Object();
        Object o2 = new Object();
View Full Code Here

    public void testIsSame() {
        Object o1 = new Object();
        Object o2 = new Object();
        Constraint p = new IsSame(o1);

        assertTrue(p.eval(o1));
        assertTrue(!p.eval(o2));
    }

    public void testIsEqual() {
        Integer i1 = new Integer(1);
View Full Code Here

        Object o1 = new Object();
        Object o2 = new Object();
        Constraint p = new IsSame(o1);

        assertTrue(p.eval(o1));
        assertTrue(!p.eval(o2));
    }

    public void testIsEqual() {
        Integer i1 = new Integer(1);
        Integer i2 = new Integer(2);
View Full Code Here

    public void testIsEqual() {
        Integer i1 = new Integer(1);
        Integer i2 = new Integer(2);
        Constraint p = new IsEqual(i1);

        assertTrue(p.eval(i1));
        assertTrue(p.eval(new Integer(1)));
        assertTrue(!p.eval(i2));
    }

    public void testIsEqualObjectArray() {
View Full Code Here

        Integer i1 = new Integer(1);
        Integer i2 = new Integer(2);
        Constraint p = new IsEqual(i1);

        assertTrue(p.eval(i1));
        assertTrue(p.eval(new Integer(1)));
        assertTrue(!p.eval(i2));
    }

    public void testIsEqualObjectArray() {
        String[] s1 = new String[]{"a", "b"};
View Full Code Here

        Integer i2 = new Integer(2);
        Constraint p = new IsEqual(i1);

        assertTrue(p.eval(i1));
        assertTrue(p.eval(new Integer(1)));
        assertTrue(!p.eval(i2));
    }

    public void testIsEqualObjectArray() {
        String[] s1 = new String[]{"a", "b"};
        String[] s2 = new String[]{"a", "b"};
View Full Code Here

        String[] s3 = new String[]{"c", "d"};
        String[] s4 = new String[]{"a", "b", "c", "d"};

        Constraint p = new IsEqual(s1);

        assertTrue("Should equal itself", p.eval(s1));
        assertTrue("Should equal a similar array", p.eval(s2));
        assertTrue("Should not equal a different array", !p.eval(s3));
        assertTrue("Should not equal a different sized array", !p.eval(s4));
    }
View Full Code Here

        String[] s4 = new String[]{"a", "b", "c", "d"};

        Constraint p = new IsEqual(s1);

        assertTrue("Should equal itself", p.eval(s1));
        assertTrue("Should equal a similar array", p.eval(s2));
        assertTrue("Should not equal a different array", !p.eval(s3));
        assertTrue("Should not equal a different sized array", !p.eval(s4));
    }

    public void testIsEqualToStringForNestedConstraint() {
View Full Code Here

        Constraint p = new IsEqual(s1);

        assertTrue("Should equal itself", p.eval(s1));
        assertTrue("Should equal a similar array", p.eval(s2));
        assertTrue("Should not equal a different array", !p.eval(s3));
        assertTrue("Should not equal a different sized array", !p.eval(s4));
    }

    public void testIsEqualToStringForNestedConstraint() {
        assertEquals("Should get an obvious toString to reflect nesting if viewed in a debugger",
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.