Exemplo n.º 1
0
        public void SickHoursTest()
        {
            TimeCard Card = new TimeCard(_startDate);

            Card.SetHours(_theNextFriday, HourType.SICK, 8);

            Assert.AreEqual(8, Card.GetHours(_theNextFriday, HourType.SICK));
        }
Exemplo n.º 2
0
 public void InvalidTimeCardTest()
 {
     try
     {
         TimeCard Card = new TimeCard(_theNextFriday);
     }
     catch (ArgumentOutOfRangeException e)
     {
         Assert.IsInstanceOfType(e, typeof(ArgumentOutOfRangeException));
     }
 }
Exemplo n.º 3
0
        public void OvertimeTest()
        {
            TimeCard Card = new TimeCard(_startDate);

            DateTime TempDate = _startDate;

            for (int x = 0; x < 14; x++)
            {
                Card.SetHours(TempDate, HourType.WORKING, 8);
                TempDate = TempDate.AddDays(1);
            }

            Assert.AreEqual(32, Card.CalculateOvertime());
        }
Exemplo n.º 4
0
        public void GetTotalHoursTest()
        {
            TimeCard Card = new TimeCard(_startDate);

            DateTime TempDate = _startDate;

            for (int x = 0; x < 14; x++)
            {
                Card.SetHours(TempDate, HourType.WORKING, 3);
                Card.SetHours(TempDate, HourType.SICK, 4);
                Card.SetHours(TempDate, HourType.VACATION, 5);
                TempDate = TempDate.AddDays(1);
            }

            Assert.AreEqual(42, Card.GetTotalHours(HourType.WORKING));
            Assert.AreEqual(56, Card.GetTotalHours(HourType.SICK));
            Assert.AreEqual(70, Card.GetTotalHours(HourType.VACATION));
        }
Exemplo n.º 5
0
        public void ValidTimeCardTest()
        {
            TimeCard Card = new TimeCard(_startDate);

            Assert.AreEqual(_startDate, Card.GetStartDate());
        }
Exemplo n.º 6
0
        public void VacationHoursTest()
        {
            TimeCard Card = new TimeCard(_startDate);

            Card.SetHours(_theNextFriday, HourType.VACATION, 8);

            Assert.AreEqual(8, Card.GetHours(_theNextFriday, HourType.VACATION));
        }
Exemplo n.º 7
0
        public void WorkingHoursTest()
        {
            TimeCard Card = new TimeCard(_startDate);

            Card.SetHours(_theNextFriday, HourType.WORKING, 8);

            Assert.AreEqual(8, Card.GetHours(_theNextFriday, HourType.WORKING));
        }