コード例 #1
0
        public void TestDateTimeRange()
        {
            DateTimeRange range = new DateTimeRange(startDate, endDate);
            DateTimeRange compareRange = new DateTimeRange(startDate, endDate);

            Assert.AreEqual(startDate, range.Start);
            Assert.AreEqual(endDate, range.End);
            Assert.AreEqual(range, compareRange);
            Assert.AreEqual(range.GetHashCode(), compareRange.GetHashCode());
        }
コード例 #2
0
        public void TestDateTimeRange()
        {
            DateTimeRange range        = new DateTimeRange(startDate, endDate);
            DateTimeRange compareRange = new DateTimeRange(startDate, endDate);

            Assert.AreEqual(startDate, range.Start);
            Assert.AreEqual(endDate, range.End);
            Assert.AreEqual(range, compareRange);
            Assert.AreEqual(range.GetHashCode(), compareRange.GetHashCode());
        }
コード例 #3
0
        public void TestDateCompare()
        {
            Assert.That(dateUnspec.CompareTo(dateLocal) == 0);
            Assert.That(dateUnspec.Equals(dateLocal));
            Assert.AreEqual(dateUnspec.GetHashCode(), dateLocal.GetHashCode());
            Assert.That(dateLocal.CompareTo(dateUnspec) == 0);
            Assert.That(dateLocal.Equals(dateUnspec));
            Assert.AreEqual(dateLocal.GetHashCode(), dateUnspec.GetHashCode());

            DateTimeRange rangeUnspec = new DateTimeRange(dateUnspec, dateUnspec);
            DateTimeRange rangeLocal  = new DateTimeRange(dateLocal, dateLocal);

            Assert.That(rangeUnspec.CompareTo(rangeLocal) == 0);
            Assert.That(rangeUnspec.Equals(rangeLocal));
            Assert.AreEqual(rangeUnspec.GetHashCode(), rangeLocal.GetHashCode());
        }
コード例 #4
0
        public void TestDateCompare()
        {
            Assert.That(dateUnspec.CompareTo(dateLocal) == 0);
            Assert.That(dateUnspec.Equals(dateLocal));
            Assert.AreEqual(dateUnspec.GetHashCode(), dateLocal.GetHashCode());
            Assert.That(dateLocal.CompareTo(dateUnspec) == 0);
            Assert.That(dateLocal.Equals(dateUnspec));
            Assert.AreEqual(dateLocal.GetHashCode(), dateUnspec.GetHashCode());

            DateTimeRange rangeUnspec = new DateTimeRange(dateUnspec, dateUnspec);
            DateTimeRange rangeLocal = new DateTimeRange(dateLocal, dateLocal);

            Assert.That(rangeUnspec.CompareTo(rangeLocal) == 0);
            Assert.That(rangeUnspec.Equals(rangeLocal));
            Assert.AreEqual(rangeUnspec.GetHashCode(), rangeLocal.GetHashCode());
        }