Examples of UsingMatchers


Examples of org.jbehave.core.mock.UsingMatchers

    Block EMPTY_BLOCK = new Block() {
        public void run() throws Exception {}
    };
   
    public void shouldProvideMatchersForDoubles() {
        UsingMatchers m = new UsingMatchers() {};
        Ensure.that(5.0, m.eq(5.0));
        Ensure.that(5.0, m.not(m.eq(5.1)));
        Ensure.that(5.0, m.eq(5.0), "message");
    }
View Full Code Here

Examples of org.jbehave.core.mock.UsingMatchers

        Ensure.that(5.0, m.not(m.eq(5.1)));
        Ensure.that(5.0, m.eq(5.0), "message");
    }
   
    public void shouldProvideMatchersForLongsAndInts() {
        UsingMatchers m = new UsingMatchers() {};
        Ensure.that(5, m.eq(5));
        Ensure.that(5, m.not(m.eq(4)));
        Ensure.that(5, m.eq(5), "message");
    }
View Full Code Here

Examples of org.jbehave.core.mock.UsingMatchers

        Ensure.that(5, m.not(m.eq(4)));
        Ensure.that(5, m.eq(5), "message");
    }
   
    public void shouldProvideMatchersForChars() {
        UsingMatchers m = new UsingMatchers() {};
        Ensure.that('a', m.eq('a'));
        Ensure.that('a', m.not(m.eq('A')));
        Ensure.that('a', m.eq('a'), "message");
    }
View Full Code Here

Examples of org.jbehave.core.mock.UsingMatchers

        Ensure.that('a', m.not(m.eq('A')));
        Ensure.that('a', m.eq('a'), "message");
    }
   
    public void shouldProvideMatchersForBooleans() {
        UsingMatchers m = new UsingMatchers() {};
        Ensure.that(true, m.eq(true));
        Ensure.that(true, m.not(m.eq(false)));
        Ensure.that(true, m.eq(true), "message");
    }
View Full Code Here

Examples of org.jbehave.core.mock.UsingMatchers

        Ensure.that(true, m.not(m.eq(false)));
        Ensure.that(true, m.eq(true), "message");
    }
   
    public void shouldProvideMatchersToCheckForNull() {
        UsingMatchers m = new UsingMatchers() {};
        Ensure.that(null, m.isNull());
        Ensure.that(new Object(), m.not(m.isNull()));
        Ensure.that(new Object(), m.isNotNull());
        Ensure.that(null, m.not(m.isNotNull()));
    }
View Full Code Here

Examples of org.jbehave.core.mock.UsingMatchers

        Ensure.that(new Object(), m.isNotNull());
        Ensure.that(null, m.not(m.isNotNull()));
    }
   
    public void shouldProvideMatchersToCheckForAnything() {
        UsingMatchers m = new UsingMatchers() {};
        Ensure.that(null, m.not(m.nothing()));
        Ensure.that(new Object(), m.not(m.nothing()));
        Ensure.that(new Object(), m.anything());
        Ensure.that(null, m.anything());
    }
View Full Code Here

Examples of org.jbehave.core.mock.UsingMatchers

        Ensure.that(new Object(), m.anything());
        Ensure.that(null, m.anything());
    }
   
    public void shouldProvideCommonStringMatchers() {
        UsingMatchers m = new UsingMatchers() {};
       
        Ensure.that("octopus", m.contains("top"));
        Ensure.that("octopus", m.not(m.contains("eight")));
        Ensure.that("octopus", m.startsWith("octo"));
        Ensure.that("octopus", m.not(m.startsWith("eight")));
        Ensure.that("octopus", m.endsWith("pus"));
        Ensure.that("octopus", m.not(m.endsWith("eight")));
    }
View Full Code Here

Examples of org.jbehave.core.mock.UsingMatchers

        Ensure.that("octopus", m.endsWith("pus"));
        Ensure.that("octopus", m.not(m.endsWith("eight")));
    }

    public void shouldProvideInstanceMatchers() {
        UsingMatchers m = new UsingMatchers() {};
       
        String a = "a";
        String b = "b";
       
        Ensure.that(a, m.is(a));
        Ensure.that(a, m.not(m.is(b)));
        Ensure.that(a, m.sameInstanceAs(a));
        Ensure.that(a, m.not(m.sameInstanceAs(b)));
    }
View Full Code Here

Examples of org.jbehave.core.mock.UsingMatchers

        Ensure.that(a, m.sameInstanceAs(a));
        Ensure.that(a, m.not(m.sameInstanceAs(b)));
    }
   
    public void shouldCatchAndReturnAThrownException() throws Exception {
        UsingMatchers m = new UsingMatchers() {};
       
        Exception exception = m.runAndCatch(IllegalArgumentException.class, EXCEPTION_BLOCK);
        Ensure.that(exception, m.isNotNull());
    }
View Full Code Here

Examples of org.jbehave.core.mock.UsingMatchers

        Exception exception = m.runAndCatch(IllegalArgumentException.class, EXCEPTION_BLOCK);
        Ensure.that(exception, m.isNotNull());
    }
   
    public void shouldCatchAndReturnNullIfNoExceptionThrown() throws Exception {
        UsingMatchers m = new UsingMatchers() {};
       
        Exception exception = m.runAndCatch(IllegalArgumentException.class, EMPTY_BLOCK);
        Ensure.that(exception, m.isNull());
    }
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.