コード例 #1
0
        public void Can_Get_Start_Of_Week()
        {
            var today   = new PersianDate(1388, 4, 25);
            var weekend = today.StartOfWeek();

            Assert.That((int)weekend.DayOfWeek, Is.EqualTo((int)DayOfWeek.Saturday));
            Assert.That(weekend.Year, Is.EqualTo(1388));
            Assert.That(weekend.Month, Is.EqualTo(4));
            Assert.That(weekend.Day, Is.EqualTo(20));
        }
コード例 #2
0
        public void Can_Get_Start_Of_Week_For_Every_Day_Of_The_Week()
        {
            var firstDay   = new PersianDate(1388, 7, 4);
            var secondDay  = new PersianDate(1388, 7, 5);
            var thirdDay   = new PersianDate(1388, 7, 6);
            var forthDay   = new PersianDate(1388, 7, 7);
            var fifthDay   = new PersianDate(1388, 7, 8);
            var sixthDay   = new PersianDate(1388, 7, 9);
            var seventhDay = new PersianDate(1388, 7, 10);

            Assert.That(firstDay.StartOfWeek(), Is.EqualTo(firstDay));
            Assert.That(secondDay.StartOfWeek(), Is.EqualTo(firstDay));
            Assert.That(thirdDay.StartOfWeek(), Is.EqualTo(firstDay));
            Assert.That(forthDay.StartOfWeek(), Is.EqualTo(firstDay));
            Assert.That(fifthDay.StartOfWeek(), Is.EqualTo(firstDay));
            Assert.That(sixthDay.StartOfWeek(), Is.EqualTo(firstDay));
            Assert.That(seventhDay.StartOfWeek(), Is.EqualTo(firstDay));
        }
コード例 #3
0
        public void Can_Get_Start_Of_Week_For_Every_Day_Of_The_Week()
        {
            var firstDay = new PersianDate(1388, 7, 4);
            var secondDay = new PersianDate(1388, 7, 5);
            var thirdDay = new PersianDate(1388, 7, 6);
            var forthDay = new PersianDate(1388, 7, 7);
            var fifthDay = new PersianDate(1388, 7, 8);
            var sixthDay = new PersianDate(1388, 7, 9);
            var seventhDay = new PersianDate(1388, 7, 10);

            Assert.That(firstDay.StartOfWeek(), Is.EqualTo(firstDay));
            Assert.That(secondDay.StartOfWeek(), Is.EqualTo(firstDay));
            Assert.That(thirdDay.StartOfWeek(), Is.EqualTo(firstDay));
            Assert.That(forthDay.StartOfWeek(), Is.EqualTo(firstDay));
            Assert.That(fifthDay.StartOfWeek(), Is.EqualTo(firstDay));
            Assert.That(sixthDay.StartOfWeek(), Is.EqualTo(firstDay));
            Assert.That(seventhDay.StartOfWeek(), Is.EqualTo(firstDay));
        }
コード例 #4
0
        public void Can_Get_Start_Of_Week()
        {
            var today = new PersianDate(1388, 4, 25);
            var weekend = today.StartOfWeek();

            Assert.That((int)weekend.DayOfWeek, Is.EqualTo((int)DayOfWeek.Saturday));
            Assert.That(weekend.Year, Is.EqualTo(1388));
            Assert.That(weekend.Month, Is.EqualTo(4));
            Assert.That(weekend.Day, Is.EqualTo(20));
        }