/*
 * The MIT License
 *
 * Copyright 2015 Adam Kowalewski.
 *
 * Permission is hereby granted, free of charge, to any person obtaining a copy
 * of this software and associated documentation files (the "Software"), to deal
 * in the Software without restriction, including without limitation the rights
 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
 * copies of the Software, and to permit persons to whom the Software is
 * furnished to do so, subject to the following conditions:
 *
 * The above copyright notice and this permission notice shall be included in
 * all copies or substantial portions of the Software.
 *
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
 * THE SOFTWARE.
 */
package com.adamkowalewski.opw.view.controller.csv;

import com.adamkowalewski.opw.view.dto.UserCsvDto;
import static org.testng.Assert.*;
import org.testng.annotations.AfterClass;
import org.testng.annotations.AfterMethod;
import org.testng.annotations.BeforeClass;
import org.testng.annotations.BeforeMethod;
import org.testng.annotations.Test;

/**
 *
 * @author Adam Kowalewski
 */
public class UserCsvDtoParserNGTest {
    
    public UserCsvDtoParserNGTest() {
    }

    @BeforeClass
    public static void setUpClass() throws Exception {
    }

    @AfterClass
    public static void tearDownClass() throws Exception {
    }

    @BeforeMethod
    public void setUpMethod() throws Exception {
    }

    @AfterMethod
    public void tearDownMethod() throws Exception {
    }

    /**
     * Test of parseEntry method, of class UserCsvDtoParser.
     */
    @Test
    public void testParseEntry() {
        System.out.println("parseEntry");
        String[] data = new String[5];
        data[0]="Jakub";
        data[1]="Arak";
        data[2]="jk@local.pl";
        data[3]="O";
        data[4]="146513-577,146513-578,146513-579";

        UserCsvDtoParser instance = new UserCsvDtoParser();
        UserCsvDto expResult = null;
        UserCsvDto result = instance.parseEntry(data);
        System.out.println("res" + result);
        assertNotNull(result);
//        assertEquals(result, expResult);
        // TODO review the generated test code and remove the default call to fail.
//        fail("The test case is a prototype.");
    }
    
}

@@ -1236,16 +1236,76 @@
 CsvDto;%0A
+import static com.google.common.collect.Lists.newArrayList;%0A
 import s
@@ -1616,20 +1616,96 @@
 GTest %7B%0A
+%0A
     
+private static String%5B%5D case1csv;%0A%0A    private static UserCsvDto case1dto;%0A
 %0A    pub
@@ -1806,32 +1806,267 @@
 ows Exception %7B%0A
+        case1csv = new String%5B%5D%7B%22Jakub%22, %22Arak%22, %22jk@local.pl%22, %22O%22, %22146513-577,146513-578,146513-579%22%7D;%0A        case1dto = new UserCsvDto(%22Jakub%22, %22Arak%22, %22jk@local.pl%22, %22O%22, newArrayList(%22146513-577%22, %22146513-578%22, %22146513-579%22));%0A%0A
     %7D%0A%0A    @Afte
@@ -2454,200 +2454,8 @@
 y%22);
-%0A        String%5B%5D data = new String%5B5%5D;%0A        data%5B0%5D=%22Jakub%22;%0A        data%5B1%5D=%22Arak%22;%0A        data%5B2%5D=%22jk@local.pl%22;%0A        data%5B3%5D=%22O%22;%0A        data%5B4%5D=%22146513-577,146513-578,146513-579%22;
 %0A%0A  
@@ -2547,12 +2547,16 @@
 t = 
-null
+case1dto
 ;%0A  
@@ -2605,12 +2605,16 @@
 try(
-data
+case1csv
 );%0A 
@@ -2687,18 +2687,16 @@
 esult);%0A
-//
         
@@ -2732,150 +2732,14 @@
 t);%0A
-        // TODO review the generated test code and remove the default call to fail.%0A//        fail(%22The test case is a prototype.%22);
 %0A    %7D%0A
-    
 %0A%7D%0A

test refactoring