public void Test_WallClockTime_AddTrueMilliseconds_And_SubtractTrueMilliseconds_Works_With_Zero(
            int year, int month, int day, int second)
        {
            //Arrange
            var dto = new DateTimeOffset(year, month, day, 0, 0, second, TimeSpan.Zero);
            var wct = WallClockTime.FromApproximateDateTimeOffset(dto);

            //Act
            var addResult       = wct.AddTrueMilliseconds(0);
            var substractResult = addResult.SubtractTrueMilliseconds(0);

            //Assert
            Assert.IsTrue(substractResult.Equals(wct));
            Assert.IsTrue(substractResult.Equals(addResult));
            Assert.IsTrue(wct.Equals(addResult));
            Assert.AreEqual(substractResult.ToApproximateDateTimeOffset(), dto);
            Assert.AreEqual(addResult.ToApproximateDateTimeOffset(), dto);
        }
        public void Test_WallClockTime_AddTrueMilliseconds_And_SubtractTrueMilliseconds_With_Different_Offsets_Results_In_Expected_Date(
            int year, int month, int day, int hour, int offsetHour, int secondsToAddAndSubstract, int expectedLeapSeconds)
        {
            //Arrange
            var msToAddAndSubstract = secondsToAddAndSubstract * 1000;
            var dto = new DateTimeOffset(year, month, day, hour, 59, 59, new TimeSpan(offsetHour, 0, 0));
            var wct = WallClockTime.FromApproximateDateTimeOffset(dto);

            //Act
            var addResult       = wct.AddTrueMilliseconds(msToAddAndSubstract);
            var substractResult = addResult.SubtractTrueMilliseconds(msToAddAndSubstract);

            //Assert
            Assert.IsTrue(substractResult.Equals(wct));
            Assert.IsTrue(substractResult >= wct);
            Assert.IsTrue(substractResult == wct);
            Assert.IsTrue(substractResult <= addResult);
            Assert.IsTrue(substractResult < addResult);
            Assert.IsTrue(substractResult != addResult);
            Assert.IsTrue(addResult > wct);
            Assert.AreEqual(substractResult.ToApproximateDateTimeOffset(), dto);
            Assert.AreEqual(addResult.ToApproximateDateTimeOffset(), dto.AddMilliseconds(msToAddAndSubstract - expectedLeapSeconds * 1000));
        }
        public void Test_WallClockTime_FromApproximateDateTimeOffset_And_FromPseudoMilliseconds_Difference_Between_Dates_Results_In_Expected_Number_Of_Leap_Seconds(
            int startYear, int startMonth, int expectedSeconds)
        {
            //Arrange
            var dtoStart = new DateTimeOffset(startYear, startMonth, 1, 0, 0, 0, TimeSpan.Zero);
            var dtoNow   = new DateTimeOffset(2025, 6, 1, 0, 0, 0, TimeSpan.Zero);

            var wctStart  = WallClockTime.FromApproximateDateTimeOffset(dtoStart);
            var wctNow    = WallClockTime.FromApproximateDateTimeOffset(dtoNow);
            var wctStart2 = WallClockTime.FromPseudoMilliseconds(dtoStart.ToUnixTimeMilliseconds());
            var wctNow2   = WallClockTime.FromPseudoMilliseconds(dtoNow.ToUnixTimeMilliseconds());

            //Act
            var dtoDiff      = dtoNow - dtoStart;
            var wctDiff      = wctNow - wctStart;
            var wctDiff2     = wctNow2 - wctStart2;
            var leapSeconds  = (wctDiff - dtoDiff).TotalSeconds;
            var leapSeconds2 = (wctDiff2 - dtoDiff).TotalSeconds;

            //Assert
            Assert.AreEqual(expectedSeconds, leapSeconds);
            Assert.AreEqual(expectedSeconds, leapSeconds2);
        }
        public void Test_WallClockTime_AddTrueMilliseconds_And_SubtractTrueMilliseconds_Works_With_Negative_Numbers(
            int year, int month, int day, int second, int negativeOrZeroSeconds, int expectedLeapSeconds)
        {
            //Arrange
            var negativeOrZeroMs = negativeOrZeroSeconds * 1000;
            var dto = new DateTimeOffset(year, month, day, 0, 0, second, TimeSpan.Zero);
            var wct = WallClockTime.FromApproximateDateTimeOffset(dto);

            //Act
            var addResult       = wct.AddTrueMilliseconds(negativeOrZeroMs);
            var substractResult = addResult.SubtractTrueMilliseconds(negativeOrZeroMs);

            //Assert
            Assert.IsTrue(substractResult.Equals(wct));
            Assert.IsTrue(substractResult <= wct);
            Assert.IsTrue(substractResult == wct);
            Assert.IsTrue(substractResult >= addResult);
            Assert.IsTrue(substractResult > addResult);
            Assert.IsTrue(substractResult != addResult);
            Assert.IsTrue(addResult < wct);
            Assert.AreEqual(substractResult.ToApproximateDateTimeOffset(), dto);
            Assert.AreEqual(addResult.ToApproximateDateTimeOffset(), dto.AddMilliseconds(negativeOrZeroMs + expectedLeapSeconds * 1000));
        }