1
2
3 package com.pnpconsult.zeiterfassung.table;
4
5 import java.text.ParseException;
6
7 import com.pnpconsult.zeiterfassung._testonly_.SimpleRateEntry;
8 import com.pnpconsult.zeiterfassung.model.UserEntry;
9
10 /***
11 * @author <a href="mailto:powerpete@users.sf.net">M. Petersen</a>
12 * @version $Id: RateRowTest.java,v 1.2 2004/03/28 16:20:55 powerpete Exp $
13 */
14 public class RateRowTest extends AbstractTableTestCase
15 {
16 public RateRowTest(String arg0)
17 {
18 super(arg0);
19 }
20
21 public void testAddObject() throws Exception
22 {
23 RateRow rateRow = new RateRow();
24 rateRow.add(newEntry("Max", 1.0F, 50.0F));
25 rateRow.add(newEntry("Max", 2.0F, 50.0F));
26 assertRateRow("Max", "50,00", "3", rateRow);
27
28 rateRow.add(newEntry("Adam", 4.0F, 50.0F));
29 assertRateRow("Adam, Max", "50,00", "7", rateRow);
30 }
31
32 private UserEntry newEntry(String name, float hours, float rate)
33 throws ParseException
34 {
35 SimpleRateEntry entry =
36 new SimpleRateEntry("", "21.09.2003", hours, rate, name);
37 return entry;
38 }
39 }