[TestMethod] // ReSharper disable once InconsistentNaming
        public void GetEnumerator_UsingLargestPossibleParameters_IteratesSuccessfully()
        {
            // Step chosen to avoid an unfeasible number of iterations
            ZonedDateTimeRange zonedDateTimeRange = new ZonedDateTimeRange(
                TestMinZonedDateTime,
                TestMaxZonedDateTime,
                Duration.FromTicks(MaxDuration.Ticks / 16));

            bool iterated = false;
            foreach (ZonedDateTime d in zonedDateTimeRange)
                iterated = true;

            Assert.AreEqual(true, iterated, "When iterating across full range, at least one value should be returned");
        }
        [TestMethod] // ReSharper disable once InconsistentNaming
        public void ToString_IsNotBlank()
        {
            Duration length = RandomDuration(MinDuration + MinDuration, MaxDuration);
            ZonedDateTime start = RandomZonedDateTime(TestMinZonedDateTime, TestMaxZonedDateTime - length);
            ZonedDateTime end = start + length;
            Duration step = RandomDuration(MinDuration, length - MinDuration);

            ZonedDateTimeRange zonedDateTimeRange = new ZonedDateTimeRange(start, end, step);

            Assert.AreNotEqual(
                "",
                zonedDateTimeRange.ToString(),
                "String representation of range must not be an empty string");
        }
        [TestMethod] // ReSharper disable once InconsistentNaming
        public void GetEnumerator_LengthNotDivisibleByStep_IterationCountMatchesCalculated()
        {
            Duration length = RandomDuration(MinDuration, MaxDuration);
            ZonedDateTime start = RandomZonedDateTime(TestMinZonedDateTime, TestMaxZonedDateTime - length);
            ZonedDateTime end = start + length;
            // note that the number of steps is limited to 1000 or fewer
            Duration step = Duration.FromTicks(length.Ticks / Random.Next(4, 1000));

            //ensure that step size is not a factor of the length of the range
            if (length.Ticks % step.Ticks == 0)
            {
                start += RandomDuration(MinDuration, step - MinDuration);
                length = end.ToInstant() - start.ToInstant();
            }

            ZonedDateTimeRange zonedDateTimeRange = new ZonedDateTimeRange(start, end, step);

            Assert.AreEqual(
                length.Ticks / step.Ticks + 1,
                zonedDateTimeRange.Count(),
                "Iteration count should be (start-end)/step +1");
        }
        [TestMethod] // ReSharper disable once InconsistentNaming
        public void GetEnumerator_Iterating_DifferenceBetweenIterationsMatchesStepSize()
        {
            Duration length = RandomDuration(MinDuration, MaxDuration);
            ZonedDateTime start = RandomZonedDateTime(TestMinZonedDateTime, TestMaxZonedDateTime - length);
            ZonedDateTime end = start + length;
            // note that the number of steps is limited to 100 or fewer
            Duration step = Duration.FromTicks(length.Ticks / Random.Next(4, 100));

            ZonedDateTimeRange zonedDateTimeRange = new ZonedDateTimeRange(start, end, step);

            ZonedDateTime? previous = null;
            foreach (ZonedDateTime d in zonedDateTimeRange)
            {
                if (previous.HasValue)
                {
                    Assert.AreEqual(
                        d.ToInstant() - previous.Value.ToInstant(),
                        step,
                        "Difference between iteration values should match the step value supplied");
                }
                previous = d;
            }
        }
        [TestMethod] // ReSharper disable once InconsistentNaming
        public void GetEnumerator_ValuesStayWithinRange()
        {
            Duration length = RandomDuration(MinDuration, MaxDuration);
            ZonedDateTime start = RandomZonedDateTime(TestMinZonedDateTime, TestMaxZonedDateTime - length);
            ZonedDateTime end = start + length;
            // note that the number of steps is limited to 100 or fewer
            Duration step = Duration.FromTicks(length.Ticks / Random.Next(4, 100));

            ZonedDateTimeRange zonedDateTimeRange = new ZonedDateTimeRange(start, end, step);

            foreach (ZonedDateTime d in zonedDateTimeRange)
            {
                Assert.IsTrue(d >= start, "Value from iterator must by equal or above start parameter");
                Assert.IsTrue(d <= end, "Value from iterator must be equal or below end parameter");
            }
        }
        [TestMethod] // ReSharper disable once InconsistentNaming
        public void GetEnumerator_LengthDivisibleByStep_IterationCountMatchesCalculated()
        {
            Duration length = RandomDuration(MinDuration, MaxDuration);
            ZonedDateTime start = RandomZonedDateTime(TestMinZonedDateTime, TestMaxZonedDateTime - length);
            ZonedDateTime end = start + length;
            // note that the number of steps is limited to 1000 or fewer
            Duration step = Duration.FromTicks(length.Ticks / Random.Next(4, 1000));

            //ensure that step size is a factor of the length of the range
            start += Duration.FromTicks(length.Ticks % step.Ticks);

            ZonedDateTimeRange zonedDateTimeRange = new ZonedDateTimeRange(start, end, step);

            // Range endpoint is inclusive, so must take longo account this extra iteration
            Assert.AreEqual(
                length.Ticks / step.Ticks + 1,
                zonedDateTimeRange.Count(),
                "Iteration count should be (end-start)/step + 1 where endpoint is included");
        }
        [TestMethod] // ReSharper disable once InconsistentNaming
        public void Constructor_WithoutStepParam_DeltaGreaterThanDay_StepDefaultsToOneDay()
        {
            Duration length = RandomDuration(Duration.FromStandardDays(1), MaxDuration);
            Trace.WriteLine(length);
            ZonedDateTime start = RandomZonedDateTime(TestMinZonedDateTime, TestMaxZonedDateTime - length);
            ZonedDateTime end = start + length;

            ZonedDateTimeRange zonedDateTimeRange = new ZonedDateTimeRange(start, end);

            Assert.AreEqual(start, zonedDateTimeRange.Start, "Starting point field must match the value supplied");
            Assert.AreEqual(end, zonedDateTimeRange.End, "End point field must match the value supplied");
            Assert.AreEqual(
                Duration.FromStandardDays(1),
                zonedDateTimeRange.Step,
                "Step amount must default to one day");
        }
        [TestMethod] // ReSharper disable once InconsistentNaming
        public void Constructor_WithoutStepParam_DeltaLessThanHour_StepDefaultsToOneMinute()
        {
            Duration length = RandomDuration(Duration.FromMinutes(1), Duration.FromHours(1));
            Trace.WriteLine(length);
            ZonedDateTime start = RandomZonedDateTime(TestMinZonedDateTime, TestMaxZonedDateTime - length);
            ZonedDateTime end = start + length;

            ZonedDateTimeRange zonedDateTimeRange = new ZonedDateTimeRange(start, end);

            Assert.AreEqual(start, zonedDateTimeRange.Start, "Starting point field must match the value supplied");
            Assert.AreEqual(end, zonedDateTimeRange.End, "End point field must match the value supplied");
            Assert.AreEqual(Duration.FromMinutes(1), zonedDateTimeRange.Step, "Step amount must default to one minute");
        }
        [ExpectedException(typeof(ArgumentOutOfRangeException))] // ReSharper disable once InconsistentNaming
        public void Constructor_EndBeforeStart_ThrowsArgumentOutOfRangeException()
        {
            Duration length = RandomDuration(MinDuration, MaxDuration);
            ZonedDateTime start = RandomZonedDateTime(TestMinZonedDateTime + length, TestMaxZonedDateTime);
            ZonedDateTime end = start - length;

            // ReSharper disable once UnusedVariable
            ZonedDateTimeRange zonedDateTimeRange = new ZonedDateTimeRange(start, end);
        }
        [TestMethod] // ReSharper disable once InconsistentNaming
        public void ToString_HasCorrectFormat()
        {
            Duration length = RandomDuration(MinDuration + MinDuration, MaxDuration);
            ZonedDateTime start = RandomZonedDateTime(TestMinZonedDateTime, TestMaxZonedDateTime - length);
            ZonedDateTime end = start + length;
            Duration step = RandomDuration(MinDuration, length - MinDuration);

            ZonedDateTimeRange zonedDateTimeRange = new ZonedDateTimeRange(start, end, step);

            Assert.AreEqual($"{start} - {end}", zonedDateTimeRange.ToString());
        }
        [TestMethod] // ReSharper disable once InconsistentNaming
        public void ToString_DoesDependOnTimeComponents()
        {
            Duration length = RandomDuration(MinDuration + MinDuration, MaxDuration);
            ZonedDateTime start = RandomZonedDateTime(TestMinZonedDateTime, TestMaxZonedDateTime - length);
            ZonedDateTime end = start + length;
            Duration step = RandomDuration(MinDuration, length - MinDuration);

            ZonedDateTimeRange zonedDateTimeRange = new ZonedDateTimeRange(start, end, step);
            ZonedDateTimeRange zonedDateTimeRangeWithTime = new ZonedDateTimeRange(
                start + RandomTimeOffset(),
                end + RandomTimeOffset(),
                step);

            Assert.AreNotEqual(
                zonedDateTimeRange.ToString(),
                zonedDateTimeRangeWithTime.ToString(),
                "String representation of range should depend on the time components");
        }