ttt307307 / junitparams

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

How to use CsvWithHeaderMapper class to skip first row (headers) in csv file? #43

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. Create a jUnit test with @Test @FileParameters(value = "test.csv") 

I would like to include header row in this file (test.csv) and I see that 
"CsvWithHeaderMapper" can handle this but I don't know how to imlement this.
Can someone post a example or a unittest using this class so I can provide a 
csv file for the QA team to populate with test data?

What version of the product are you using? On what operating system?
1.0.1, Windows XP

Please provide any additional information below.
using STS 3.2.0 and jUnit 4.11

Original issue reported on code.google.com by colm.har...@gmail.com on 1 May 2013 at 4:01

GoogleCodeExporter commented 8 years ago
RTFTests :-)

@Test
@FileParameters(value = "classpath:with_header.csv", mapper = 
CsvWithHeaderMapper.class)
public void csvWithHeader(int id, String name) {
    assertTrue(id > 0);
}

--- 
ID,NAME
1,first
2,second

Original comment by lipinski...@gmail.com on 7 Jun 2013 at 4:07

GoogleCodeExporter commented 8 years ago
That's great, thanks. Nice and simple !

Original comment by colm.har...@gmail.com on 10 Jun 2013 at 9:03