View Javadoc
1   /*
2    * #%L
3    * IsisFish
4    * 
5    * $Id: InputSaveVerifierTest.java 4218 2015-05-07 08:47:11Z echatellier $
6    * $HeadURL: https://svn.codelutin.com/isis-fish/tags/isis-fish-4.4.0.2/src/test/java/fr/ifremer/isisfish/ui/input/InputSaveVerifierTest.java $
7    * %%
8    * Copyright (C) 2009 - 2012 Ifremer, Code Lutin, Chatellier Eric
9    * %%
10   * This program is free software: you can redistribute it and/or modify
11   * it under the terms of the GNU General Public License as
12   * published by the Free Software Foundation, either version 3 of the 
13   * License, or (at your option) any later version.
14   * 
15   * This program is distributed in the hope that it will be useful,
16   * but WITHOUT ANY WARRANTY; without even the implied warranty of
17   * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18   * GNU General Public License for more details.
19   * 
20   * You should have received a copy of the GNU General Public 
21   * License along with this program.  If not, see
22   * <http://www.gnu.org/licenses/gpl-3.0.html>.
23   * #L%
24   */
25  package fr.ifremer.isisfish.ui.input;
26  
27  import org.junit.Assert;
28  import org.junit.Test;
29  
30  import fr.ifremer.isisfish.entities.Population;
31  import fr.ifremer.isisfish.entities.PopulationImpl;
32  import fr.ifremer.isisfish.entities.PopulationSeasonInfo;
33  import fr.ifremer.isisfish.entities.PopulationSeasonInfoImpl;
34  import fr.ifremer.isisfish.types.Month;
35  
36  /**
37   * Test InputVerifier.
38   * 
39   * @author Eric Chatellier
40   */
41  public class InputSaveVerifierTest {
42  
43      /**
44       * Test toString method.
45       * @throws Exception 
46       */
47      @Test
48      public void testToString() throws Exception {
49          Population pop = new PopulationImpl();
50          pop.setName("Test1");
51          Assert.assertEquals("Test1", new InputSaveVerifier().toString(pop));
52          
53          PopulationSeasonInfo psi = new PopulationSeasonInfoImpl();
54          psi.setPopulation(pop);
55          psi.setFirstMonth(Month.JANUARY);
56          psi.setLastMonth(Month.MARCH);
57          Assert.assertEquals("Test1 saison janvier-mars", new InputSaveVerifier().toString(psi));
58      }
59  }