Package org.moresbycoffee.mbyhave8.structure

Examples of org.moresbycoffee.mbyhave8.structure.Scenario


        assertThat(scenario.getTags(), contains("TEST TAG1"));
    }

    @Test
    public void should_add_all_tags_to_scenario() {
        final Scenario scenario = successScenario();
        scenario.tag("TEST TAG1").tag("TEST TAG2");
        assertThat(scenario.getTags(), contains("TEST TAG1", "TEST TAG2"));
    }
View Full Code Here


        assertThat(scenario.getTags(), contains("TEST TAG1", "TEST TAG2"));
    }

    @Test
    public void should_add_multiple_tags_to_scenario() {
        final Scenario scenario = successScenario();
        scenario.tag("TEST TAG1", "TEST TAG2");
        assertThat(scenario.getTags(), contains("TEST TAG1", "TEST TAG2"));
    }
View Full Code Here

        assertThat(scenario.getTags(), contains("TEST TAG1", "TEST TAG2"));
    }

    @Test
    public void should_trim_the_tags_on_scenarios() {
        final Scenario scenario = successScenario();
        scenario.tag("tag1   ", "   ", "   tag2", "tag3", null);
        assertThat(scenario.getTags(), contains("tag1", "tag2", "tag3"));
    }
View Full Code Here

        assertThat(scenario.getTags(), contains("tag1", "tag2", "tag3"));
    }

    @Test
    public void should_should_not_do_anything_with_null_tag() {
        final Scenario scenario = successScenario();
        scenario.tag(null);
        assertTrue(scenario.getTags().isEmpty());
    }
View Full Code Here

    }


    @Test
    public void should_add_issue_to_scenario() {
        final Scenario scenario = successScenario();
        scenario.issue("MBH-1");
        assertThat(scenario.getIssues(), contains("MBH-1"));
    }
View Full Code Here

        assertThat(scenario.getIssues(), contains("MBH-1"));
    }

    @Test
    public void should_add_multiple_issues_to_scenario() {
        final Scenario scenario = successScenario();
        scenario.issue("MBH-1", "MBH-2").issue("MBH-3");
        assertThat(scenario.getIssues(), contains("MBH-1", "MBH-2", "MBH-3"));
    }
View Full Code Here

        assertThat(scenario.getIssues(), contains("MBH-1", "MBH-2", "MBH-3"));
    }

    @Test
    public void should_handle_null_issue_on_scenario() {
        final Scenario scenario = successScenario();
        scenario.issue(null);
        assertTrue(scenario.getIssues().isEmpty());
    }
View Full Code Here

        assertTrue(scenario.getIssues().isEmpty());
    }

    @Test
    public void should_trim_the_issues_on_scenario() {
        final Scenario scenario = successScenario();
        scenario.issue("MBH-1   ", "   ", "   MBH-2", "MBH-3", null);
        assertThat(scenario.getIssues(), contains("MBH-1", "MBH-2", "MBH-3"));
    }
View Full Code Here

        assertThat(scenario.getIssues(), contains("MBH-1", "MBH-2", "MBH-3"));
    }

    @Test
    public void should_add_issues_to_tags_as_well_on_a_scenario() {
        final Scenario scenario = successScenario();
        scenario.tag("tag1").issue("MBH-1", "MBH-2");
        assertThat(scenario.getTags(), contains("tag1", "MBH-1", "MBH-2"));
    }
View Full Code Here

    public void second_step_should_not_run_after_a_failing_step() {

        final AtomicBoolean isWhenVisited = new AtomicBoolean(false);
        final AtomicBoolean isThenVisited = new AtomicBoolean(false);

        final Scenario scenario = new MByHaveSpec() {
            Scenario scenario = Scenario("scenario description",
                    given("given step", (VoidStepImplementation) () -> { throw new AssertionError(); }),
                    when("when step", () -> { isWhenVisited.set(true); }),
                    then("then step", () -> { isThenVisited.set(true); }));
        }.scenario;

        final ScenarioOutput output = scenario.execute(DummyScenarioHooks.DUMMY);

        assertFalse("The when step should not run", isWhenVisited.get());
        assertFalse("The then step should not run", isThenVisited.get());

        assertEquals(ScenarioResult.Failure, output.getResult());
View Full Code Here

TOP

Related Classes of org.moresbycoffee.mbyhave8.structure.Scenario

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.