コード例 #1
0
        public void DataTypes_DateHelpers_isNextWeek()
        {
            var today = new System.DateTime(2017, 9, 25);

            Assert.IsTrue(TimexDateHelpers.IsNextWeek(new System.DateTime(2017, 10, 4), today));
            Assert.IsFalse(TimexDateHelpers.IsNextWeek(new System.DateTime(2017, 9, 27), today));
            Assert.IsFalse(TimexDateHelpers.IsNextWeek(today, today));
        }
コード例 #2
0
        public void DataTypes_DateHelpers_invariance()
        {
            var d      = new System.DateTime(2017, 8, 25);
            var before = d;

            TimexDateHelpers.Tomorrow(d);
            TimexDateHelpers.Yesterday(d);
            TimexDateHelpers.DatePartEquals(new System.DateTime(), d);
            TimexDateHelpers.DatePartEquals(d, new System.DateTime());
            TimexDateHelpers.IsNextWeek(d, new System.DateTime());
            TimexDateHelpers.IsNextWeek(new System.DateTime(), d);
            TimexDateHelpers.IsLastWeek(new System.DateTime(), d);
            TimexDateHelpers.WeekOfYear(d);
            var after = d;

            Assert.AreEqual(after, before);
        }