FrutillaParser { static Given given(String text) { reset(); final Given given = new Given(text); sRoot = given; return given; }    }
@Frutilla( Given = "a 'then' sentence", When = "is declared", Then = "the sentence exists" ) @Test public void testThen() throws Exception { given(GIVEN).when(WHEN).then(THEN); assertHas(THEN); }
@Frutilla( Given = "multiple 'then' sentences", When = "are added", Then = "all sentences exist" ) @Test public void testThenMultiple() throws Exception { given(GIVEN).when(WHEN).then(THEN).and(ONE).and(TWO); assertHas(ONE); assertHas(TWO); }
@Frutilla( Given = "a 'given' sentence", When = "is declared", Then = "the sentence exists" ) @Test public void testGiven() throws Exception { given(GIVEN); assertHas(GIVEN); }
@Frutilla( Given = "multiple 'given' sentences", When = "are added", Then = "all sentences exist" ) @Test public void testGivenMultiple() throws Exception { given(GIVEN).and(ONE).and(TWO); assertHas(ONE); assertHas(TWO); }
@Frutilla( Given = "multiple 'given' sentences", When = "are added to the same 'given' instance variable", Then = "all sentences exist" ) @Test public void testGivenMultipleMultiline() throws Exception { FrutillaParser.Given given = given(GIVEN); given.and(ONE); given.and(TWO); assertHas(ONE); assertHas(TWO); }
@Frutilla( Given = { "all kind of sentences", "BUT starting with 'given'" }, When = "are added", Then = "all exist" ) @Test public void testAllTogetherStartingWithGiven() throws Exception { given(GIVEN).and(ONE).when(WHEN).and(TWO).then(THEN).and(THREE); assertHas(GIVEN); assertHas(WHEN); assertHas(THEN); assertHas(ONE); assertHas(TWO); assertHas(THREE); }
@Frutilla( Given = "a 'when' sentence", When = "is declared", Then = "the sentence exists" ) @Test public void testWhen() throws Exception { given(GIVEN).when(WHEN); assertHas(WHEN); }
@Frutilla( Given = "multiple 'when' sentences", When = "are added", Then = "all sentences exist" ) @Test public void testWhenMultiple() throws Exception { given(GIVEN).when(WHEN).and(ONE).and(TWO); assertHas(ONE); assertHas(TWO); }