ttt307307 / junitparams

Automatically exported from code.google.com/p/junitparams
0 stars 0 forks source link

Escape semicolons when entering params as strings #2

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
I'm preparing tests for table cell renderer. As and input I'm providing two 
strings: one with value to format, and another with formatted value:

@RunWith(JUnitParamsRunner.class)
public class SemicolonsInParametersTest {

    @Test
    @Parameters({ "1.2, 1,20", "0, 0,00" })
    public void shouldAllowToEnterSemicolonsInParameters(String value, String formattedValue) {

        assertThat(format(value)).isEqualTo(formattedValue);
    }

    private String format(String value) {
        return value;
    }
}

After executing a test I'm getting exception:

java.lang.IllegalArgumentException: wrong number of arguments

What is the expected output? What do you see instead?

I would like to have a way of escaping "," in parameters declaration and get 
proper assertion information.

What version of the product are you using? On what operating system?

I'm using version 0.3.0 of JUnitParams.

Original issue reported on code.google.com by kamil.be...@pragmatists.pl on 31 May 2011 at 11:00

Attachments:

GoogleCodeExporter commented 8 years ago
Params in annotations are not meant to be anything complex / needing any 
special syntax. If it's not clear with the semicolons, it means it should be 
externalised to a param provider method.

Original comment by lipinski...@gmail.com on 14 Jun 2011 at 8:04