It feels that this should have a simple solution, but I can't figure it out...

Is there a simple way to overload for example "then" -statements?
Meaning, say I have following thens in different scenarios:

Then country has name Finland
Then country has name Finland and code FI

If my steps object has methods

    @Then("country has name Finland $name")
    public void assertName(String name) {
        assertEquals(name, country.getName());
    }

    @Then("country has name Finland $name and code $code")
    public void assertNameAndCode(String name, String code) {
        assertEquals(name, country.getName());
        assertEquals(code, country.getCode());
    }

This fails since second then in a story calls assertName(name) with
name = "Finland and code FI".

Is there a way to write a story so that it would call
assertNameAndCode(name, code)?

I know I can rewrite the second story step as "Then country has code
FI and name Finland" but am curious whether there's an alternative
way.

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email


Reply via email to