Package org.jbehave.core.mock

Examples of org.jbehave.core.mock.Mock.expects()


        Mock component = mock(ScenarioComponentWithCleanUp.class);
        AbstractStep step = new StubbedAbstractStep((ScenarioComponent)component);
        World world = new HashMapWorld();
       
        // expect
        component.expects("cleanUp").with(world);
       
        // when
        step.cleanUp(world);
       
        // then
View Full Code Here


        Mock outcome = mock(Outcome.class);
        AbstractStep step = new OutcomeStep((Outcome)outcome);
        World world = new HashMapWorld();
       
        // expect
        outcome.expects("verify").with(world);
       
        // when
        step.perform(world);
       
        // then
View Full Code Here

        Mock behaviour = mock(Behaviour.class);
        Mock listener = mock(BehaviourListener.class);
        BehaviourVerifier verifier = new BehaviourVerifier((BehaviourListener) listener);
       
        // expect...
        listener.expects("before").with(behaviour);
        behaviour.expects("verifyTo").with(verifier).after(listener, "before");
        listener.expects("after").with(behaviour).after(behaviour, "verifyTo");
       
        // when...
        verifier.verifyBehaviour((Behaviour)behaviour);
View Full Code Here

        Mock event = mock(Event.class);
        EventStep step = new EventStep((Event)event);
        World world = new HashMapWorld();
       
        // expect
        event.expects("occurIn").with(world);
       
        // when
        step.perform(world);
       
        // then
View Full Code Here

        BehaviourVerifier verifier = new BehaviourVerifier((BehaviourListener) listener);
       
        // expect...
        listener.expects("before").with(behaviour);
        behaviour.expects("verifyTo").with(verifier).after(listener, "before");
        listener.expects("after").with(behaviour).after(behaviour, "verifyTo");
       
        // when...
        verifier.verifyBehaviour((Behaviour)behaviour);
       
        // then...
View Full Code Here

        // given...
        Narrative narrative = new Narrative("role", "feature", "benefit");
        Mock renderer = mock(Renderer.class);
       
        // expect...
        renderer.expects("renderNarrative").with(narrative);

        // when...
        narrative.narrateTo((Renderer)renderer);
       
        // then...
View Full Code Here

        Mock listener = mock(BehaviourListener.class);
        Behaviour behaviour = new BehaviourClass(
                ClassWithTwoBehaviourMethods.class, new BehaviourVerifier((BehaviourListener) listener));
       
        // expect
        listener.expects("gotResult").with(successfulResultFromMethodCalled("shouldDoOneThing"));
        listener.expects("gotResult").with(successfulResultFromMethodCalled("shouldDoAnotherThing"));
       
        // when
        behaviour.verifyTo((BehaviourListener) listener);
       
View Full Code Here

        Behaviour behaviour = new BehaviourClass(
                ClassWithTwoBehaviourMethods.class, new BehaviourVerifier((BehaviourListener) listener));
       
        // expect
        listener.expects("gotResult").with(successfulResultFromMethodCalled("shouldDoOneThing"));
        listener.expects("gotResult").with(successfulResultFromMethodCalled("shouldDoAnotherThing"));
       
        // when
        behaviour.verifyTo((BehaviourListener) listener);
       
        // then
View Full Code Here

        Mock listener = mock(BehaviourListener.class);
        Behaviour behaviour = new BehaviourClass(
                ClassWithNestedClasses.class, new BehaviourVerifier((BehaviourListener) listener));
       
        // expect
        listener.expects("gotResult").with(successfulResultFromMethodCalled("shouldDoSomething1"));
        listener.expects("gotResult").with(successfulResultFromMethodCalled("shouldDoSomething2"));
       
        // when
        behaviour.verifyTo((BehaviourListener) listener);
       
View Full Code Here

        Behaviour behaviour = new BehaviourClass(
                ClassWithNestedClasses.class, new BehaviourVerifier((BehaviourListener) listener));
       
        // expect
        listener.expects("gotResult").with(successfulResultFromMethodCalled("shouldDoSomething1"));
        listener.expects("gotResult").with(successfulResultFromMethodCalled("shouldDoSomething2"));
       
        // when
        behaviour.verifyTo((BehaviourListener) listener);
       
        // then
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.