Package org.jbehave.core.mock

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


        };
        scenario.specify();
        World world = new HashMapWorld();
       
        // expect
        given.expects("setUp").with(world);
       
        // when
        scenario.run(world);
       
        // then
View Full Code Here


        };
        scenario.specify();
        World world = new HashMapWorld();
       
        // expect
        event.expects("occurIn").with(world);
       
        // when
        scenario.run(world);
       
        // then
View Full Code Here

        };
        scenario.specify();
        World world = new HashMapWorld();
       
        // expect
        outcome.expects("verify").with(world);
       
        // when
        scenario.run(world);
       
        // then
View Full Code Here

        scenario.specify();
       
        // expect
        given.expects("setUp").with(world);
        event.expects("occurIn").with(world).after(given, "setUp");
        outcome.expects("verify").with(world).after(event, "occurIn");
       
        // when
        scenario.run(world);
       
        // then
View Full Code Here

            }
        };
        scenario.specify();

        // expect
        outcome.expects("cleanUp").with(world);
        event.expects("cleanUp").never();
        given.expects("cleanUp").with(world).after(outcome, "cleanUp");

        // when
        scenario.run(world);
View Full Code Here

            }
        };
        scenario.specify();
       
        // expect
        renderer.expects("renderScenario").with(scenario);
        given.expects("narrateTo").with(renderer).after(renderer, "renderScenario");
        event.expects("narrateTo").with(renderer).after(given, "narrateTo");
        outcome.expects("narrateTo").with(renderer).after(event, "narrateTo");
       
        // when
View Full Code Here

        final Mock outcome = mock(Outcome.class);
       
        // expect
        given.expects("containsMocks").will(returnValue(false));
        event.expects("containsMocks").will(returnValue(false));
        outcome.expects("containsMocks").will(returnValue(true)); // has mocks

        Scenario scenario = new MultiStepScenario() {
            public void specifySteps() {
                given((Given)given);
                when((Event)event);
View Full Code Here

        final Mock outcome = mock(Outcome.class);
       
        // expect
        given.expects("containsMocks").will(returnValue(false));
        event.expects("containsMocks").will(returnValue(true)); // succeeds fast at second step
        outcome.expects("containsMocks").never();               // so third step not checked
       
        Scenario scenario = new MultiStepScenario() {
            public void specifySteps() {
                given((Given)given);
                when((Event)event);
View Full Code Here

        final Mock outcome = mock(Outcome.class);
       
        // expect
        given.expects("containsMocks").will(returnValue(false));
        event.expects("containsMocks").will(returnValue(false));
        outcome.expects("containsMocks").will(returnValue(false));
       
        Scenario scenario = new MultiStepScenario() {
            public void specifySteps() {
                given((Given)given);
                when((Event)event);
View Full Code Here

        scenario.specify();
       
        // expect
        given1.expects("setUp").with(world);
        given2.expects("setUp").with(world).after(given1, "setUp");
        outcome.expects("setExpectationsIn").with(world).after(given2, "setUp");
        event.expects("occurIn").with(world).after(outcome, "setExpectationsIn");
        outcome.expects("verify").with(world).after(event, "occurIn");
       
        // when
        scenario.run(world);
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.