예제 #1
0
        public void Can_convert_Month_Systems()
        {
            //leap year
            Assert.That(jewishCalendar.NativeMonthToJewishMonth(1, true), Is.EqualTo(JewishCalendar.JewishMonth.TISHREI));
            Assert.That(jewishCalendar.NativeMonthToJewishMonth(2, true), Is.EqualTo(JewishCalendar.JewishMonth.CHESHVAN));
            Assert.That(jewishCalendar.NativeMonthToJewishMonth(3, true), Is.EqualTo(JewishCalendar.JewishMonth.KISLEV));
            Assert.That(jewishCalendar.NativeMonthToJewishMonth(4, true), Is.EqualTo(JewishCalendar.JewishMonth.TEVES));
            Assert.That(jewishCalendar.NativeMonthToJewishMonth(5, true), Is.EqualTo(JewishCalendar.JewishMonth.SHEVAT));
            Assert.That(jewishCalendar.NativeMonthToJewishMonth(6, true), Is.EqualTo(JewishCalendar.JewishMonth.ADAR));
            Assert.That(jewishCalendar.NativeMonthToJewishMonth(7, true), Is.EqualTo(JewishCalendar.JewishMonth.ADAR_II));
            Assert.That(jewishCalendar.NativeMonthToJewishMonth(8, true), Is.EqualTo(JewishCalendar.JewishMonth.NISSAN));
            Assert.That(jewishCalendar.NativeMonthToJewishMonth(9, true), Is.EqualTo(JewishCalendar.JewishMonth.IYAR));
            Assert.That(jewishCalendar.NativeMonthToJewishMonth(10, true), Is.EqualTo(JewishCalendar.JewishMonth.SIVAN));
            Assert.That(jewishCalendar.NativeMonthToJewishMonth(11, true), Is.EqualTo(JewishCalendar.JewishMonth.TAMMUZ));
            Assert.That(jewishCalendar.NativeMonthToJewishMonth(12, true), Is.EqualTo(JewishCalendar.JewishMonth.AV));
            Assert.That(jewishCalendar.NativeMonthToJewishMonth(13, true), Is.EqualTo(JewishCalendar.JewishMonth.ELUL));

            //regular year
            Assert.That(jewishCalendar.NativeMonthToJewishMonth(1, false), Is.EqualTo(JewishCalendar.JewishMonth.TISHREI));
            Assert.That(jewishCalendar.NativeMonthToJewishMonth(2, false), Is.EqualTo(JewishCalendar.JewishMonth.CHESHVAN));
            Assert.That(jewishCalendar.NativeMonthToJewishMonth(3, false), Is.EqualTo(JewishCalendar.JewishMonth.KISLEV));
            Assert.That(jewishCalendar.NativeMonthToJewishMonth(4, false), Is.EqualTo(JewishCalendar.JewishMonth.TEVES));
            Assert.That(jewishCalendar.NativeMonthToJewishMonth(5, false), Is.EqualTo(JewishCalendar.JewishMonth.SHEVAT));
            Assert.That(jewishCalendar.NativeMonthToJewishMonth(6, false), Is.EqualTo(JewishCalendar.JewishMonth.ADAR));
            Assert.That(jewishCalendar.NativeMonthToJewishMonth(7, false), Is.EqualTo(JewishCalendar.JewishMonth.NISSAN));
            Assert.That(jewishCalendar.NativeMonthToJewishMonth(8, false), Is.EqualTo(JewishCalendar.JewishMonth.IYAR));
            Assert.That(jewishCalendar.NativeMonthToJewishMonth(9, false), Is.EqualTo(JewishCalendar.JewishMonth.SIVAN));
            Assert.That(jewishCalendar.NativeMonthToJewishMonth(10, false), Is.EqualTo(JewishCalendar.JewishMonth.TAMMUZ));
            Assert.That(jewishCalendar.NativeMonthToJewishMonth(11, false), Is.EqualTo(JewishCalendar.JewishMonth.AV));



            //leap year
            Assert.That(jewishCalendar.JewishMonthToNativeMonth(JewishCalendar.JewishMonth.NISSAN, true), Is.EqualTo(8));
            Assert.That(jewishCalendar.JewishMonthToNativeMonth(JewishCalendar.JewishMonth.IYAR, true), Is.EqualTo(9));
            Assert.That(jewishCalendar.JewishMonthToNativeMonth(JewishCalendar.JewishMonth.SIVAN, true), Is.EqualTo(10));
            Assert.That(jewishCalendar.JewishMonthToNativeMonth(JewishCalendar.JewishMonth.TAMMUZ, true), Is.EqualTo(11));
            Assert.That(jewishCalendar.JewishMonthToNativeMonth(JewishCalendar.JewishMonth.AV, true), Is.EqualTo(12));
            Assert.That(jewishCalendar.JewishMonthToNativeMonth(JewishCalendar.JewishMonth.ELUL, true), Is.EqualTo(13));
            Assert.That(jewishCalendar.JewishMonthToNativeMonth(JewishCalendar.JewishMonth.TISHREI, true), Is.EqualTo(1));
            Assert.That(jewishCalendar.JewishMonthToNativeMonth(JewishCalendar.JewishMonth.CHESHVAN, true), Is.EqualTo(2));
            Assert.That(jewishCalendar.JewishMonthToNativeMonth(JewishCalendar.JewishMonth.KISLEV, true), Is.EqualTo(3));
            Assert.That(jewishCalendar.JewishMonthToNativeMonth(JewishCalendar.JewishMonth.TEVES, true), Is.EqualTo(4));
            Assert.That(jewishCalendar.JewishMonthToNativeMonth(JewishCalendar.JewishMonth.SHEVAT, true), Is.EqualTo(5));
            Assert.That(jewishCalendar.JewishMonthToNativeMonth(JewishCalendar.JewishMonth.ADAR, true), Is.EqualTo(6));
            Assert.That(jewishCalendar.JewishMonthToNativeMonth(JewishCalendar.JewishMonth.ADAR_II, true), Is.EqualTo(7));


            //regular year
            Assert.That(jewishCalendar.JewishMonthToNativeMonth(JewishCalendar.JewishMonth.NISSAN, false), Is.EqualTo(7));
            Assert.That(jewishCalendar.JewishMonthToNativeMonth(JewishCalendar.JewishMonth.IYAR, false), Is.EqualTo(8));
            Assert.That(jewishCalendar.JewishMonthToNativeMonth(JewishCalendar.JewishMonth.SIVAN, false), Is.EqualTo(9));
            Assert.That(jewishCalendar.JewishMonthToNativeMonth(JewishCalendar.JewishMonth.TAMMUZ, false), Is.EqualTo(10));
            Assert.That(jewishCalendar.JewishMonthToNativeMonth(JewishCalendar.JewishMonth.AV, false), Is.EqualTo(11));
            Assert.That(jewishCalendar.JewishMonthToNativeMonth(JewishCalendar.JewishMonth.ELUL, false), Is.EqualTo(12));
            Assert.That(jewishCalendar.JewishMonthToNativeMonth(JewishCalendar.JewishMonth.TISHREI, false), Is.EqualTo(1));
            Assert.That(jewishCalendar.JewishMonthToNativeMonth(JewishCalendar.JewishMonth.CHESHVAN, false), Is.EqualTo(2));
            Assert.That(jewishCalendar.JewishMonthToNativeMonth(JewishCalendar.JewishMonth.KISLEV, false), Is.EqualTo(3));
            Assert.That(jewishCalendar.JewishMonthToNativeMonth(JewishCalendar.JewishMonth.TEVES, false), Is.EqualTo(4));
            Assert.That(jewishCalendar.JewishMonthToNativeMonth(JewishCalendar.JewishMonth.SHEVAT, false), Is.EqualTo(5));
            Assert.That(jewishCalendar.JewishMonthToNativeMonth(JewishCalendar.JewishMonth.ADAR, false), Is.EqualTo(6));
        }