示例#1
0
 public void ПроверкаВисокосностиГодов()
 {
     Assert.AreEqual(MyDate.IsYearLeap(2015), false);
     Assert.AreEqual(MyDate.IsYearLeap(2000), true);
     Assert.AreEqual(MyDate.IsYearLeap(1900), false);
     Assert.AreEqual(MyDate.IsYearLeap(2008), true);
 }
示例#2
0
        public void ЧислоДнейВДате2()
        {
            var myDate = new MyDate(1, 1, 2);
            int result = 0;

            for (var i = 0; i < myDate.Year; i++)
            {
                if (MyDate.IsYearLeap(i))
                {
                    result += 366;
                }
                else
                {
                    result += 365;
                }
            }

            Assert.AreEqual(myDate.GetDaysCount(), result);
        }