Package org.jbehave.core.mock

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


        // 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);
       
        // then
View Full Code Here


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

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

    }
   
    public void shouldSpecifyScenarioWhenAddingAsAGiven() {
        final Mock scenario = mock(Scenario.class);
        World world = (World)stub(World.class);
        scenario.expects("specify");
       
        Scenario parentScenario = new MultiStepScenario() {
            public void specifySteps() {
                given((Scenario)scenario);
            }
View Full Code Here

        ensureThat(exception, isNotNull());
    }
   
    public void shouldRethrowExceptionsInStepsAsVerificationExceptions() throws Exception {
        final Mock given = mock(GivenWithCleanUp.class, "given");
        given.expects("setUp").will(throwException(new Exception()));
       
        final Scenario scenario = new MultiStepScenario(){
            public void specifySteps() {
                given((Given) given);
            }};
View Full Code Here

    }
   
    public void shouldNotRethrowVerificationExceptionsInSteps() throws Exception {
        final Mock given = mock(GivenWithCleanUp.class, "given");
        VerificationException verificationException = new VerificationException("My message");
        given.expects("setUp").will(throwException(verificationException));
       
        final Scenario scenario = new MultiStepScenario(){
            public void specifySteps() {
                given((Given) given);
            }};
View Full Code Here

        Scenario scenario = new MultiStepScenario() {
            public void specifySteps() {
                given((Given) given);
            }};
           
        given.expects("cleanUp").never();
           
        scenario.specify();
        scenario.cleanUp(world);
       
        verifyMocks();
View Full Code Here

            public void specifySteps() {
                given((Given) given);
               
            }};
           
        given.expects("cleanUp").once();
           
        scenario.specify();
        scenario.run(world);
        scenario.cleanUp(world);
        scenario.cleanUp(world);
View Full Code Here

            public void specifySteps() {
                given((Given) given);
               
            }};
           
        given.expects("setUp").will(throwException(new VerificationException("")));
        given.expects("cleanUp").once();
           
        scenario.specify();
       
        try {
View Full Code Here

                given((Given) given);
               
            }};
           
        given.expects("setUp").will(throwException(new VerificationException("")));
        given.expects("cleanUp").once();
           
        scenario.specify();
       
        try {
            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.