Example #1
0
        private void SetDateRange(object objectParameter)
        {
            string dateRange = objectParameter.ToString();

            switch (dateRange)
            {
            case "ThisWeek":
                StartDate = DateTimeExtensions.StartOfWeek(DateTime.Today, DayOfWeek.Monday);
                EndDate   = DateTimeExtensions.EndOfWeek(DateTime.Today, DayOfWeek.Monday);
                break;

            case "LastWeek":
                StartDate = DateTimeExtensions.StartOfLastWeek(DateTime.Today, DayOfWeek.Monday);
                EndDate   = DateTimeExtensions.EndOfLastWeek(DateTime.Today, DayOfWeek.Monday);
                break;

            case "CurrentMonth":
                StartDate = DateTimeExtensions.FirstDayOfMonth(DateTime.Today);
                EndDate   = DateTimeExtensions.LastDayOfMonth(DateTime.Today);
                break;

            default:
                break;
            }
        }
        public void EndOfWeekTest(int year, int calendarweek, DateTime startResult, DateTime endResult)
        {
            var datetime = DateTimeExtensions.EndOfWeek(year, calendarweek);

            AssertEqualDateTime(datetime, endResult);
        }