Esempio n. 1
0
        public void TestCheckIfIsSundayReturnsFalseOnANonSundayDate()
        {
            //3rd February 2017 was on Friday
            StringDate date = new StringDate(3, 2, 2017);

            Assert.IsFalse(date.isSunday());
        }
Esempio n. 2
0
        public void TestCheckIfIsSundayReturnsTrueOnASundayDate()
        {
            //12nd February 2017 was on Sunday
            StringDate date = new StringDate(12, 2, 2017);

            Assert.IsTrue(date.isSunday());
        }
Esempio n. 3
0
        public void TestIncrementDateByOneDayAndThatIncrementChangesTheYear()
        {
            StringDate date = new StringDate(31, 12, 2015);

            date.nextDay();
            Assert.AreEqual("01012016", date.getDate());
        }
Esempio n. 4
0
        public void TestIncrementDateByOneDayAndThatIncrementChangesTheMonth()
        {
            StringDate date = new StringDate(31, 1, 2017);

            date.nextDay();
            Assert.AreEqual("01022017", date.getDate());
        }
Esempio n. 5
0
        public void TestIncrementDateByOneDay()
        {
            StringDate date = new StringDate(1, 1, 2017);

            date.nextDay();
            Assert.AreEqual("02012017", date.getDate());
        }
Esempio n. 6
0
        public void TestGetStringDateYearNumber()
        {
            StringDate date = new StringDate(3, 2, 2017);

            Assert.AreEqual(2017, date.getYearNumber());
        }
Esempio n. 7
0
        public void TestGetStringDateMonthNumber()
        {
            StringDate date = new StringDate(3, 2, 2017);

            Assert.AreEqual(2, date.getMonthNumber());
        }
Esempio n. 8
0
        public void TestGetStringDateDayNumber()
        {
            StringDate date = new StringDate(3, 2, 2017);

            Assert.AreEqual(3, date.getDayNumber());
        }
Esempio n. 9
0
        public void TestCreateAStringDateAndGetItInDDMMYYYYformat()
        {
            StringDate date = new StringDate(1, 2, 2017);

            Assert.AreEqual("01022017", date.getDate());
        }