コード例 #1
0
ファイル: HebrewDateTest.cs プロジェクト: zeroxist/Libraries
        public void FindפרשהTest()
        {
            for (int hebrewYear = 5344; hebrewYear < 6000; hebrewYear++)
            {
                for (int parshaIndex = 0; parshaIndex < 53; parshaIndex++)
                {
                    var expectedParsha = HebrewDate.Parshiyos[parshaIndex];
                    var date           = HebrewDate.Findפרשה(hebrewYear, parshaIndex);

                    Assert.AreEqual(DayOfWeek.Saturday, date.DayOfWeek);                                        //We should get a שבת
                    //Assert.AreEqual(hebrewYear, date.HebrewYear, date + " (" + expectedParsha + ")");			//We should get the year we asked for
                    Assert.AreEqual(date, HebrewDate.Findפרשה(hebrewYear, expectedParsha));                     //We should get the same date by index & by name

                    var actualParsha = date.Parsha;
                    Assert.IsTrue(actualParsha == expectedParsha ||
                                  actualParsha.StartsWith(expectedParsha + "־") ||
                                  actualParsha.EndsWith("־" + expectedParsha)
                                  );                              //We should get the פרשה that we asked for.
                }
            }
            Assert.Inconclusive("I must figure out how to handle years without וילך.");
        }