Package com.volantis.testtools.mock

Examples of com.volantis.testtools.mock.TestSimpleExpectation


        return createCompositeExpectation();
    }

    public void testImmutable() {
        CompositeExpectation expectation = createCompositeExpectation();
        expectation.addExpectation(new TestSimpleExpectation("A"));

        ((InternalExpectation) expectation).makeImmutable();

        try {
            expectation.addExpectation(new TestSimpleExpectation("B"));

            fail("Did not detect attempt to change immutable expectation");
        } catch (IllegalStateException e) {
        }
    }
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

     */
    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.
        repeating.checkExpectations(ExpectationState.CURRENT, new TestEvent("A"), report);
View Full Code Here

     */
    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.
        repeating.checkExpectations(ExpectationState.CURRENT, new TestEvent("A"), report);
View Full Code Here

     */
    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.
        try {
View Full Code Here

TOP

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

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.