Example #1
0
        private DateTime GetAutumnalEquinox(int year)
        {
            long   curYear = 0, month = 0, day = 0, hour = 0, minutes = 0;
            double seconds = 0;
            var    date    = new AASDate();
            var    spring  = AASEquinoxesAndSolstices.SouthwardEquinox(year, true);

            date.Set(spring, true);
            date.Get(ref curYear, ref month, ref day, ref hour, ref minutes, ref seconds);
            var dt       = new DateTime((int)curYear, (int)month, (int)day, (int)hour, (int)minutes, (int)seconds);
            var converDt = TimeZoneInfo.ConvertTimeFromUtc(dt, timeZone);

            return(converDt);
        }
        public void LengthOfSummerTest(long year, bool isNorthernHemisphere, bool bHighPrecision, double expectedResult)
        {
            double summerLength = AASEquinoxesAndSolstices.LengthOfSummer(year, isNorthernHemisphere, bHighPrecision);

            Assert.Equal(expectedResult, summerLength);
        }
        public void SouthwardEquinoxTest(long year, bool bHighPrecision, double expectedResult)
        {
            double septemberEquinox = AASEquinoxesAndSolstices.SouthwardEquinox(year, bHighPrecision);

            Assert.Equal(expectedResult, septemberEquinox);
        }
        public void NorthwardEquinoxTest(long year, bool bHighPrecision, double expectedResult)
        {
            double marchEquinox = AASEquinoxesAndSolstices.NorthwardEquinox(year, bHighPrecision);

            Assert.Equal(expectedResult, marchEquinox);
        }
        public void SouthernSolsticeTest(long year, bool bHighPrecision, double expectedResult)
        {
            double decemberSolstice = AASEquinoxesAndSolstices.SouthernSolstice(year, bHighPrecision);

            Assert.Equal(expectedResult, decemberSolstice);
        }
        public void NorthernSolsticeTest(long year, bool bHighPrecision, double expectedResult)
        {
            double juneSolstice = AASEquinoxesAndSolstices.NorthernSolstice(year, bHighPrecision);

            Assert.Equal(expectedResult, juneSolstice);
        }