Exemple #1
0
        public void TestEqualityOfLeapSeconds()
        {
            JulianDate leapSecond = new JulianDate(2453736, 43233, TimeStandard.InternationalAtomicTime);
            JulianDate utcDate    = new JulianDate(2453736, 43233, TimeStandard.CoordinatedUniversalTime);

            Assert.IsFalse(utcDate.Equals(leapSecond));
            Assert.IsFalse(leapSecond.Equals(utcDate));
        }
Exemple #2
0
        public void TestEquality()
        {
            JulianDate first  = new JulianDate(2451545, 0.2);
            JulianDate second = new JulianDate(2451545, 0.2);

            Assert.AreEqual(first, second);
            Assert.IsTrue(first.Equals(second));
            Assert.IsTrue(second.Equals(first));
            Assert.AreEqual(0, first.CompareTo(second));
            Assert.AreEqual(0, second.CompareTo(first));
            Assert.AreNotEqual(first, 5);

            first  = new JulianDate(2451545, 0.00001);
            second = new JulianDate(2451544, 86399.99999);
            Assert.AreNotEqual(first, second);
            Assert.IsFalse(first.Equals(second));
            Assert.IsFalse(second.Equals(first));
            Assert.AreNotEqual(0, first.CompareTo(second));
            Assert.AreNotEqual(0, second.CompareTo(first));
            Assert.IsTrue(first.EqualsEpsilon(second, 1e-4));
            Assert.IsTrue(second.EqualsEpsilon(first, 1e-4));
        }
        public void TestEquality()
        {
            JulianDate first = new JulianDate(2451545, 0.2);
            JulianDate second = new JulianDate(2451545, 0.2);
            Assert.AreEqual(first, second);
            Assert.IsTrue(first.Equals(second));
            Assert.IsTrue(second.Equals(first));
            Assert.AreEqual(0, first.CompareTo(second));
            Assert.AreEqual(0, second.CompareTo(first));
            Assert.AreNotEqual(first, 5);

            first = new JulianDate(2451545, 0.00001);
            second = new JulianDate(2451544, 86399.99999);
            Assert.AreNotEqual(first, second);
            Assert.IsFalse(first.Equals(second));
            Assert.IsFalse(second.Equals(first));
            Assert.AreNotEqual(0, first.CompareTo(second));
            Assert.AreNotEqual(0, second.CompareTo(first));
            Assert.IsTrue(first.EqualsEpsilon(second, 1e-4));
            Assert.IsTrue(second.EqualsEpsilon(first, 1e-4));
        }
        public void TestEqualityOfLeapSeconds()
        {
            JulianDate leapSecond = new JulianDate(2453736, 43233, TimeStandard.InternationalAtomicTime);
            JulianDate utcDate = new JulianDate(2453736, 43233, TimeStandard.CoordinatedUniversalTime);

            Assert.IsFalse(utcDate.Equals(leapSecond));
            Assert.IsFalse(leapSecond.Equals(utcDate));
        }