Package com.volantis.testtools.mock

Examples of com.volantis.testtools.mock.Expectation


    // Javadoc inherited.
    public void debug(Report report) {
        before(report);
        int size = expectations.size();
        for (int i = 0; i < size; i += 1) {
            Expectation expectation = (Expectation) expectations.get(i);
            ((AbstractExpectation) expectation).debug(report);
        }
        after(report);
    }
View Full Code Here


    }
*/

    public void testOptional() {

        Expectation nested = new TestSimpleExpectation("A");
        RepeatingExpectation repeating = new RepeatingExpectation(0, 1, nested);

        // It should be partially satisfied without any events.
        repeating.verify();

View Full Code Here

                   repeating.isCompletelySatisfied(ExpectationState.CURRENT));
    }

    public void testOptionalPartialSatisfaction() {

        Expectation nested = new TestSimpleExpectation("A");
        RepeatingExpectation repeating = new RepeatingExpectation(0, 1, nested);

        // It should be partially satisfied without any events.
        repeating.verify();
View Full Code Here

                   EventEffect.WOULD_SATISFY, effect);
    }

    public void testAtLeastOne() {

        Expectation nested = new TestSimpleExpectation("A");
        RepeatingExpectation repeating
                = new RepeatingExpectation(1, Integer.MAX_VALUE, nested);

        try {
            // It should not be partially satisfied without any events.
View Full Code Here

                    repeating.isCompletelySatisfied(ExpectationState.CURRENT));
    }

    public void testFixedNumber() {

        Expectation nested = new TestSimpleExpectation("A");
        RepeatingExpectation repeating
                = new RepeatingExpectation(3, 3, nested);

        try {
            // It should not be partially satisfied without any events.
View Full Code Here

    /**
     * Test that a repeating expectation can be partially satisfied.
     */
    public void testPartialSatisfaction() {

        Expectation nested = new TestSimpleExpectation("A");
        RepeatingExpectation repeating
                = new RepeatingExpectation(1, 2, nested);

        // Process and event to move it into a partially satisfied state.
        repeating.checkExpectations(ExpectationState.CURRENT, new TestEvent("A"), report);
View Full Code Here

     * Test that a repeating expectation that is not partially satisfied fails
     * properly when given an event it cannot consume.
     */
    public void testPartialDissatisfaction() {

        Expectation nested = new TestSimpleExpectation("A");
        RepeatingExpectation repeating
                = new RepeatingExpectation(2, 3, nested);

        // Process and event to move it towards a partially satisfied state.
        repeating.checkExpectations(ExpectationState.CURRENT, new TestEvent("A"), report);
View Full Code Here

     * expectation and the event cannot be processed by that expectation.
     */
    public void testNestedOptionalPartialSatisfaction() {

        // Create an optional expectation.
        Expectation nested = new RepeatingExpectation(
                0, 1, new TestSimpleExpectation("A"));
        RepeatingExpectation repeating
                = new RepeatingExpectation(1, 2, nested);

        // Process and event to move it into a partially satisfied state.
View Full Code Here

     * is always satisfied if the nested one is satisfied.
     */
    public void testNestedOptionalPartialAlwaysSatisfied() {

        // Create an optional expectation.
        Expectation nested = new RepeatingExpectation(
                0, 1, new TestSimpleExpectation("A"));
        RepeatingExpectation repeating
                = new RepeatingExpectation(20, 300, nested);

        // Process and event to move it towards a partially satisfied state.
View Full Code Here

     * expectation and the event cannot be processed by that expectation.
     */
    public void testNestedOptionalPartialUnsatisfaction() {

        // Create an optional expectation.
        Expectation nested = new RepeatingExpectation(
                0, 1, new TestSimpleExpectation("A"));
        RepeatingExpectation repeating
                = new RepeatingExpectation(1, 2, nested);

        // Make sure that it is not partially satisfied.
View Full Code Here

TOP

Related Classes of com.volantis.testtools.mock.Expectation

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.