Example #1
0
        public void Get_Moon_Times_Time_Specified_Returns_MoonRise_And_Set_Times()
        {
            //Arrange
            var date = new DateTime(2020, 5, 13, 10, 16, 0, DateTimeKind.Utc);
            var lat  = 48.2026;
            var lng  = 16.3684;

            //Act
            var moonPhase = MoonCalc.GetMoonPhase(date, lat, lng);

            //Assert
            Assert.Null(moonPhase.Rise);
            Assert.NotNull(moonPhase.Set);
            var set = moonPhase.Set.Value.ToString("yyyy-MM-dd hh:mm:ss");

            Assert.Equal("2020-05-13 08:37:56", set);
            Assert.False(moonPhase.AlwaysDown);
            Assert.False(moonPhase.AlwaysUp);
        }
Example #2
0
        public void Get_Moon_Times_Returns_MoonRise_And_Set_Times()
        {
            //Arrange
            var date = new DateTime(2013, 3, 4, 0, 0, 0, DateTimeKind.Utc);
            var lat  = 50.5;
            var lng  = 30.5;

            //Act
            var moonPhase = MoonCalc.GetMoonPhase(date, lat, lng);

            //Assert
            Assert.NotNull(moonPhase.Rise);
            Assert.NotNull(moonPhase.Set);
            var rise = moonPhase.Rise.Value.ToString("yyyy-MM-dd hh:mm:ss");
            var set  = moonPhase.Set.Value.ToString("yyyy-MM-dd hh:mm:ss");

            Assert.Equal("2013-03-04 11:54:29", rise);
            Assert.Equal("2013-03-04 07:47:58", set);
            Assert.False(moonPhase.AlwaysDown);
            Assert.False(moonPhase.AlwaysUp);
        }