示例#1
0
        public void UnknownDayNotThisYear()
        {
            var date = "?/Aug/9";

            var parsedDate = UkcDateParser.CalculateDate(date);

            Assert.AreEqual(parsedDate.Year, 9);
            Assert.AreEqual(parsedDate.Month, 8);
            Assert.AreEqual(parsedDate.Day, 15);
        }
示例#2
0
        public void UnknownDayThisYear()
        {
            var date = "?/Apr";

            var parsedDate = UkcDateParser.CalculateDate(date);

            Assert.AreEqual(parsedDate.Year, DateTimeOffset.Now.Year);
            Assert.AreEqual(parsedDate.Month, 4);
            Assert.AreEqual(parsedDate.Day, 15);
        }
示例#3
0
        public void KnownNotThisYear()
        {
            var date = "3/Sep/14";

            var parsedDate = UkcDateParser.CalculateDate(date);

            Assert.AreEqual(parsedDate.Year, 2014);
            Assert.AreEqual(parsedDate.Month, 9);
            Assert.AreEqual(parsedDate.Day, 3);
        }
示例#4
0
        public void UnknownMonthNotThisYear()
        {
            var date = "??/12";

            var parsedDate = UkcDateParser.CalculateDate(date);

            Assert.AreEqual(parsedDate.Year, 12);
            Assert.AreEqual(parsedDate.Month, 6);
            Assert.AreEqual(parsedDate.Day, 15);
        }
示例#5
0
        public void KnownThisYear()
        {
            var date = "12/May";

            var parsedDate = UkcDateParser.CalculateDate(date);

            Assert.AreEqual(parsedDate.Year, DateTimeOffset.Now.Year);
            Assert.AreEqual(parsedDate.Month, 5);
            Assert.AreEqual(parsedDate.Day, 12);
        }