public static void Main()
    {
        // Creates and initializes a JulianCalendar.
        JulianCalendar myCal = new JulianCalendar();

        // Displays the header.
        Console.Write("YEAR\t");
        for (int y = 2001; y <= 2005; y++)
        {
            Console.Write("\t{0}", y);
        }
        Console.WriteLine();

        // Checks five years in the current era.
        Console.Write("CurrentEra:");
        for (int y = 2001; y <= 2005; y++)
        {
            Console.Write("\t{0}", myCal.IsLeapYear(y, JulianCalendar.CurrentEra));
        }
        Console.WriteLine();

        // Checks five years in each of the eras.
        for (int i = 0; i < myCal.Eras.Length; i++)
        {
            Console.Write("Era {0}:\t", myCal.Eras[i]);
            for (int y = 2001; y <= 2005; y++)
            {
                Console.Write("\t{0}", myCal.IsLeapYear(y, myCal.Eras[i]));
            }
            Console.WriteLine();
        }
    }
示例#2
0
        public static void JulianTest()
        {
            JulianCalendar jc = new JulianCalendar();

            Assert.False(jc.IsLeapYear(1999));
        }
示例#3
0
 public static void JulianTest()
 {
     JulianCalendar jc = new JulianCalendar();
     Assert.False(jc.IsLeapYear(1999));
 }