コード例 #1
0
ファイル: HolidayTest.cs プロジェクト: bdqnghi/j2cstranslator
        internal void ExerciseHoliday(Holiday h, ILOG.J2CsMapping.Util.Locale locale)
        {
            Logln("holiday: " + h.GetDisplayName());
            Logln("holiday in " + locale + ": " + h.GetDisplayName(locale));

            DateTime first = h.FirstAfter(longTimeAgo);
            Logln("firstAfter: " + longTimeAgo + " is " + first);
            if (first == null)
            {
                first = longTimeAgo;
            }
            first = new DateTime(((first.Ticks / 10000) + awhile) * 10000);

            DateTime second = h.FirstBetween(first, now);
            Logln("firstBetween: " + first + " and " + now + " is " + second);
            if (second == null)
            {
                second = now;
            }

            Logln("is on " + first + ": " + h.IsOn(first));
            Logln("is on " + now + ": " + h.IsOn(now));
            Logln("is between " + first + " and " + now + ": "
                    + h.IsBetween(first, now));
            Logln("is between " + first + " and " + second + ": "
                    + h.IsBetween(first, second));

            // logln("rule: " + h.getRule().toString());

            // h.setRule(h.getRule());
        }