예제 #1
0
        public void Can_use_all_the_months()
        {
            DateTime date;

            date = new Month(1).The(1);
            Assert.That(date.Month, Is.EqualTo(1));
            date = new Month(2).The(1);
            Assert.That(date.Month, Is.EqualTo(2));
            date = new Month(3).The(1);
            Assert.That(date.Month, Is.EqualTo(3));
            date = new Month(4).The(1);
            Assert.That(date.Month, Is.EqualTo(4));
            date = new Month(5).The(1);
            Assert.That(date.Month, Is.EqualTo(5));
            date = new Month(6).The(1);
            Assert.That(date.Month, Is.EqualTo(6));
            date = new Month(7).The(1);
            Assert.That(date.Month, Is.EqualTo(7));
            date = new Month(8).The(1);
            Assert.That(date.Month, Is.EqualTo(8));
            date = new Month(9).The(1);
            Assert.That(date.Month, Is.EqualTo(9));
            date = new Month(10).The(1);
            Assert.That(date.Month, Is.EqualTo(10));
            date = new Month(11).The(1);
            Assert.That(date.Month, Is.EqualTo(11));
            date = new Month(12).The(1);
            Assert.That(date.Month, Is.EqualTo(12));
        }
예제 #2
0
        public void Can_use_The()
        {
            var year = DateTime.Now.Year;

            for (int i = 1; i < 13; i++)
            {
                for (int j = 1; j < 32; j++)
                {
                    if (i == 2 && j > 28)
                        break;

                    if ( (i == 9 || i == 4 || i == 6 || i == 11) && j > 30)
                        break;

                    var date = new Month(i).The(j);
                    Assert.That(date, Is.EqualTo(new DateTime(year, i, j)));
                }
            }
        }
예제 #3
0
 public void Can_use_The_x_properties()
 {
     DateTime date = new Month(1).The1st;
     Assert.That(date.Day, Is.EqualTo(1));
     date = new Month(1).The2nd;
     Assert.That(date.Day, Is.EqualTo(2));
     date = new Month(1).The3rd;
     Assert.That(date.Day, Is.EqualTo(3));
     date = new Month(1).The4th;
     Assert.That(date.Day, Is.EqualTo(4));
     date = new Month(1).The5th;
     Assert.That(date.Day, Is.EqualTo(5));
     date = new Month(1).The6th;
     Assert.That(date.Day, Is.EqualTo(6));
     date = new Month(1).The7th;
     Assert.That(date.Day, Is.EqualTo(7));
     date = new Month(1).The8th;
     Assert.That(date.Day, Is.EqualTo(8));
     date = new Month(1).The9th;
     Assert.That(date.Day, Is.EqualTo(9));
     date = new Month(1).The10th;
     Assert.That(date.Day, Is.EqualTo(10));
     date = new Month(1).The11th;
     Assert.That(date.Day, Is.EqualTo(11));
     date = new Month(1).The12th;
     Assert.That(date.Day, Is.EqualTo(12));
     date = new Month(1).The13th;
     Assert.That(date.Day, Is.EqualTo(13));
     date = new Month(1).The14th;
     Assert.That(date.Day, Is.EqualTo(14));
     date = new Month(1).The15th;
     Assert.That(date.Day, Is.EqualTo(15));
     date = new Month(1).The16th;
     Assert.That(date.Day, Is.EqualTo(16));
     date = new Month(1).The17th;
     Assert.That(date.Day, Is.EqualTo(17));
     date = new Month(1).The18th;
     Assert.That(date.Day, Is.EqualTo(18));
     date = new Month(1).The19th;
     Assert.That(date.Day, Is.EqualTo(19));
     date = new Month(1).The20th;
     Assert.That(date.Day, Is.EqualTo(20));
     date = new Month(1).The21st;
     Assert.That(date.Day, Is.EqualTo(21));
     date = new Month(1).The22nd;
     Assert.That(date.Day, Is.EqualTo(22));
     date = new Month(1).The23rd;
     Assert.That(date.Day, Is.EqualTo(23));
     date = new Month(1).The24th;
     Assert.That(date.Day, Is.EqualTo(24));
     date = new Month(1).The25th;
     Assert.That(date.Day, Is.EqualTo(25));
     date = new Month(1).The26th;
     Assert.That(date.Day, Is.EqualTo(26));
     date = new Month(1).The27th;
     Assert.That(date.Day, Is.EqualTo(27));
     date = new Month(1).The28th;
     Assert.That(date.Day, Is.EqualTo(28));
     date = new Month(1).The29th;
     Assert.That(date.Day, Is.EqualTo(29));
     date = new Month(1).The30th;
     Assert.That(date.Day, Is.EqualTo(30));
     date = new Month(1).The31st;
     Assert.That(date.Day, Is.EqualTo(31));
 }