コード例 #1
0
        private void AssertEqual(DateTimeZone first, DateTimeZone second,
                                 Instant start, Instant end, Options options)
        {
            var comparer = ZoneEqualityComparer.ForInterval(new Interval(start, end)).WithOptions(options);

            Assert.IsTrue(comparer.Equals(first, second));
            Assert.AreEqual(comparer.GetHashCode(first), comparer.GetHashCode(second));
        }
コード例 #2
0
        private void AssertNotEqual(DateTimeZone first, DateTimeZone second,
                                    Instant start, Instant end, Options options)
        {
            var comparer = ZoneEqualityComparer.ForInterval(new Interval(start, end)).WithOptions(options);

            Assert.IsFalse(comparer.Equals(first, second));
            // If this fails, the code *could* still be correct - but it's unlikely...
            Assert.AreNotEqual(comparer.GetHashCode(first), comparer.GetHashCode(second));
        }