public static RiseTransitSetModel GetRiseTransitSet(
            this CelestialObjectPositionModel celestialObjectPosition,
            CelestialObjectPositionModel earthPosition,
            double longitudeDegrees,
            double latitudeDegrees)
        {
            var transitTimeSpan = celestialObjectPosition.GetTransitTimeSpan(earthPosition, longitudeDegrees);

            var transit = new DateTimeOffset(
                celestialObjectPosition.ReferenceDate.DateTime.Year,
                celestialObjectPosition.ReferenceDate.DateTime.Month,
                celestialObjectPosition.ReferenceDate.DateTime.Day,
                transitTimeSpan.Hours,
                transitTimeSpan.Minutes,
                transitTimeSpan.Seconds,
                transitTimeSpan.Milliseconds,
                TimeSpan.Zero);

            var hourHorizonDegrees  = celestialObjectPosition.GetHourHorizon(latitudeDegrees, 0);
            var hourHorizonTimeSpan = DegreeHelper.DegreeToTimeSpan(hourHorizonDegrees);
            var rise = transit - hourHorizonTimeSpan;
            var set  = transit + hourHorizonTimeSpan;

            return(new RiseTransitSetModel(rise, transit, set));
        }
        public void DegreeToTimeTest(double value, int expectedHours, int expectedMinutes, int expectedSeconds)
        {
            var actualTimeSpan = DegreeHelper.DegreeToTimeSpan(value);

            Assert.Equal(expectedHours, actualTimeSpan.Hours);
            Assert.Equal(expectedMinutes, actualTimeSpan.Minutes);
            Assert.Equal(expectedSeconds, actualTimeSpan.Seconds);
        }
        public static TimeSpan GetTransitTimeSpan(
            this CelestialObjectPositionModel celestialObjectPosition,
            CelestialObjectPositionModel earthPosition,
            double longitudeDegrees)
        {
            var degrees = celestialObjectPosition.GetTransitDegrees(
                earthPosition,
                longitudeDegrees);

            return(DegreeHelper.DegreeToTimeSpan(degrees));
        }
        public void DegreeTimeSpanConversionTest(double value)
        {
            var actualTimeSpan   = DegreeHelper.DegreeToTimeSpan(value);
            var expectedTimeSpan = new TimeSpan((int)Math.Floor(value / 15), (int)Math.Floor(value % 15) * 4, (int)Math.Floor((value % 0.25) * 240));

            Assert.Equal(expectedTimeSpan.Hours, actualTimeSpan.Hours);
            Assert.Equal(expectedTimeSpan.Minutes, actualTimeSpan.Minutes);
            Assert.Equal(expectedTimeSpan.Seconds, actualTimeSpan.Seconds);

            var actualDegrees = DegreeHelper.TimeSpanToDegree(actualTimeSpan);

            Assert.Equal(value, actualDegrees);
        }