public IWorkYear CreateNewWorkYear(int year, Employee employee, List <PayPeriod> periods)
    {
        IWorkYear workYear = null;

        workYear = new WorkYear(year, employee, periods);
        return(workYear);
    }
示例#2
0
        public void WorkYear_ctor_CreateWholeYear()
        {
            WorkYear wy = new WorkYear(2011, new WorkDayParserSettings(), 0, 1, null, null);

            Assert.AreEqual(12, wy.Months.Count);
            //test sample month
            var march = wy.Months.ElementAt(2);

            Assert.AreEqual(5, march.Weeks.Count);
            Assert.AreEqual(31, march.Weeks.Sum(w => w.Days.Count()));
            Assert.AreEqual(DayOfWeek.Tuesday, march.Weeks.First().Days.First().DayOfWeek);
        }