package senac_turma02.data;

import junit.framework.*;
import java.util.Date;
import java.util.Calendar;

public class TestDiaUtil extends TestCase {
  private Calendar calendario;

  public TestDiaUtil(String args) {
   super(args);
  }
  public void setUp() {
   calendario = Calendar.getInstance();
  }
  public void testSextaFeira() throws Exception {
   calendario.set(2003, 05-1, 9, 0, 0, 0);
   DiaUtil dia = new DiaUtil(calendario.getTime());
   calendario.set(2003, 05-1, 9, 0, 0, 0);
   Date data = calendario.getTime();
   assertEquals(data, dia);
  }
  public void testSabado() throws Exception {
   calendario.set(2003, 05-1, 10, 0, 0, 0);
   DiaUtil dia = new DiaUtil(calendario.getTime());
   calendario.set(2003, 05-1, 12, 0, 0, 0);
   Date data = calendario.getTime();
   assertEquals(data, dia);
  }
  public void testDomingo() throws Exception {
   calendario.set(2003, 05-1, 11, 0, 0, 0);
   DiaUtil dia = new DiaUtil(calendario.getTime());
   calendario.set(2003, 05-1, 12, 0, 0, 0);
   Date data = calendario.getTime();
   assertEquals(data, dia);
  }
  public void testSegundaFeira() throws Exception {
   calendario.set(2003, 05-1, 12, 0, 0, 0);
   DiaUtil dia = new DiaUtil(calendario.getTime());
   Date data = calendario.getTime();
   assertEquals(data, dia);
  }
  public static Test suite() {
   return new TestSuite(TestDiaUtil.class);
  }
}
