コード例 #1
0
        public void TestStatusSecsInvalid()
        {
            const string dateString = "2199-01-01T23:00:60";
            var          testDate   = DatePair.Parse(dateString);

            Assert.AreEqual(DateStatus.Invalid, testDate.StartValue.Status);
        }
コード例 #2
0
        public void TestStatusMonthInvalid()
        {
            const string dateString = "2199-13";
            var          testDate   = DatePair.Parse(dateString);

            Assert.AreEqual(DateStatus.Invalid, testDate.StartValue.Status);
        }
コード例 #3
0
        public void TestStatusDayInvalidLeap()
        {
            const string dateString = "2019-02-29";
            var          testDate   = DatePair.Parse(dateString);

            Assert.AreEqual(DateStatus.Invalid, testDate.StartValue.Status);
        }
コード例 #4
0
        public void TestNullDate()
        {
            const string dateString = "2019-01-00";
            var          testDate   = DatePair.Parse(dateString);

            Assert.AreEqual(DateStatus.Invalid, testDate.StartValue.Status);
        }
コード例 #5
0
        public void TestMinusDate()
        {
            const string dateString = "-";
            var          testDate   = DatePair.Parse(dateString);

            Assert.AreEqual(DateStatus.Invalid, testDate.StartValue.Status);
        }
コード例 #6
0
        public void TestEmptyDate()
        {
            const string dateString = "";
            var          testDate   = DatePair.Parse(dateString);

            Assert.AreEqual(DateStatus.Unused, testDate.StartValue.Status);
        }
コード例 #7
0
        public void TestWrongJune()
        {
            const string dateString = "2019-06-31";
            var          testDate   = DatePair.Parse(dateString);

            Assert.AreEqual(DateStatus.Invalid, testDate.StartValue.Status);
        }
コード例 #8
0
        public void TestStatusAndPartStatusSync()
        {
            const string dateString = "X199";
            var          testDate   = DatePair.Parse(dateString);

            Assert.IsTrue(testDate.StartValue.Year.Invalid);
            Assert.AreEqual(DateStatus.Invalid, testDate.StartValue.Status);
        }
コード例 #9
0
        public void TestStatusDayValidLeapMod1000()
        {
            const string dateString = "2000-02-29";
            var          testDate   = DatePair.Parse(dateString);

            Assert.AreEqual(DateStatus.Normal, testDate.StartValue.Status);
            Assert.AreEqual(2000, testDate.StartValue.Year.Value);
            Assert.AreEqual(2, testDate.StartValue.Month.Value);
            Assert.AreEqual(29, testDate.StartValue.Day.Value);
        }