static void Celestial_Tests()
        {
            Console.WriteLine("Loading Celestial Values...");
            Console.WriteLine();
            CelestialTests ct = new CelestialTests();

            ct.Populate_CelestialTests();
            Write_Pass("Sunset: ", ct.Check_Values(ct.SunSets, "CelestialData\\SunSet.txt"));
            Write_Pass("Sunrise: ", ct.Check_Values(ct.SunRises, "CelestialData\\SunRise.txt"));
            Write_Pass("AstroDawn: ", ct.Check_Values(ct.AstroDawn, "CelestialData\\AstroDawn.txt"));
            Write_Pass("AstroDusk: ", ct.Check_Values(ct.AstroDusk, "CelestialData\\AstroDusk.txt"));
            Write_Pass("CivilDawn: ", ct.Check_Values(ct.CivilDawn, "CelestialData\\CivilDawn.txt"));
            Write_Pass("CivilDusk: ", ct.Check_Values(ct.CivilDusk, "CelestialData\\CivilDusk.txt"));
            Write_Pass("NauticalDawn: ", ct.Check_Values(ct.NauticalDawn, "CelestialData\\NauticalDawn.txt"));
            Write_Pass("NauticalDusk: ", ct.Check_Values(ct.NauticalDusk, "CelestialData\\NauticalDusk.txt"));
            Write_Pass("BottomSolarDiscRise: ", ct.Check_Values(ct.BottomSolarDiscRise, "CelestialData\\BottomDiscRise.txt"));
            Write_Pass("BottomSolarDiscSet: ", ct.Check_Values(ct.BottomSolarDiscSet, "CelestialData\\BottomDiscSet.txt"));
            Write_Pass("Moon Set: ", ct.Check_Values(ct.MoonSets, "CelestialData\\MoonSet.txt"));
            Write_Pass("Moon Rise: ", ct.Check_Values(ct.MoonRises, "CelestialData\\MoonRise.txt"));
            Console.WriteLine();
            Write_Pass("Sun Altitude: ", ct.Check_Values(ct.SunAlts, "CelestialData\\SunAlts.txt"));
            Write_Pass("Sun Azimuth: ", ct.Check_Values(ct.SunAzs, "CelestialData\\SunAzs.txt"));
            Write_Pass("Moon Altitude: ", ct.Check_Values(ct.MoonAlts, "CelestialData\\MoonAlts.txt"));
            Write_Pass("Moon Azimuth: ", ct.Check_Values(ct.MoonAzs, "CelestialData\\MoonAzs.txt"));
            Write_Pass("Moon Distance: ", ct.Check_Values(ct.MoonDistances, "CelestialData\\MoonDistance.txt"));
            Write_Pass("Moon Fraction: ", ct.Check_Values(ct.MoonFraction, "CelestialData\\MoonFraction.txt"));
            Write_Pass("Moon Phase ", ct.Check_Values(ct.MoonPhase, "CelestialData\\MoonPhase.txt"));
            Write_Pass("Moon Phase Name: ", ct.Check_Values(ct.MoonPhaseName, "CelestialData\\MoonPhaseName.txt"));
            Console.WriteLine();
            Write_Pass("Solar Eclipse: ", ct.Check_Solar_Eclipse());
            Write_Pass("Lunar Eclipse: ", ct.Check_Lunar_Eclipse());
            Write_Pass("Perigee: ", ct.Check_Perigee());
            Write_Pass("Apogee: ", ct.Check_Apogee());
        }
Exemple #2
0
        public static void Run_Test()
        {
            Console.WriteLine("Loading Celestial Values...");
            Console.WriteLine();
            CelestialTests ct = new CelestialTests();

            ct.Populate_CelestialTests();
            Coordinate c = new Coordinate();

            Pass.Write("Sunset: ", ct.Check_Values(ct.SunSets, "CelestialData\\SunSet.txt"));
            Pass.Write("Sunrise: ", ct.Check_Values(ct.SunRises, "CelestialData\\SunRise.txt"));
            Pass.Write("AstroDawn: ", ct.Check_Values(ct.AstroDawn, "CelestialData\\AstroDawn.txt"));
            Pass.Write("AstroDusk: ", ct.Check_Values(ct.AstroDusk, "CelestialData\\AstroDusk.txt"));
            Pass.Write("CivilDawn: ", ct.Check_Values(ct.CivilDawn, "CelestialData\\CivilDawn.txt"));
            Pass.Write("CivilDusk: ", ct.Check_Values(ct.CivilDusk, "CelestialData\\CivilDusk.txt"));
            Pass.Write("NauticalDawn: ", ct.Check_Values(ct.NauticalDawn, "CelestialData\\NauticalDawn.txt"));
            Pass.Write("NauticalDusk: ", ct.Check_Values(ct.NauticalDusk, "CelestialData\\NauticalDusk.txt"));
            Pass.Write("BottomSolarDiscRise: ", ct.Check_Values(ct.BottomSolarDiscRise, "CelestialData\\BottomDiscRise.txt"));
            Pass.Write("BottomSolarDiscSet: ", ct.Check_Values(ct.BottomSolarDiscSet, "CelestialData\\BottomDiscSet.txt"));
            Pass.Write("Moon Set: ", ct.Check_Values(ct.MoonSets, "CelestialData\\MoonSet.txt"));
            Pass.Write("Moon Rise: ", ct.Check_Values(ct.MoonRises, "CelestialData\\MoonRise.txt"));
            Console.WriteLine();
            Pass.Write("Sun Altitude: ", ct.Check_Values(ct.SunAlts, "CelestialData\\SunAlts.txt"));
            Pass.Write("Sun Azimuth: ", ct.Check_Values(ct.SunAzs, "CelestialData\\SunAzs.txt"));
            Pass.Write("Moon Altitude: ", ct.Check_Values(ct.MoonAlts, "CelestialData\\MoonAlts.txt"));
            Pass.Write("Moon Azimuth: ", ct.Check_Values(ct.MoonAzs, "CelestialData\\MoonAzs.txt"));
            Pass.Write("Moon Distance: ", ct.Check_Values(ct.MoonDistances, "CelestialData\\MoonDistance.txt"));
            Pass.Write("Moon Fraction: ", ct.Check_Values(ct.MoonFraction, "CelestialData\\MoonFraction.txt"));
            Pass.Write("Moon Phase ", ct.Check_Values(ct.MoonPhase, "CelestialData\\MoonPhase.txt"));
            Pass.Write("Moon Phase Name: ", ct.Check_Values(ct.MoonPhaseName, "CelestialData\\MoonPhaseName.txt"));
            Console.WriteLine();
            Pass.Write("Solar Eclipse: ", ct.Check_Solar_Eclipse());
            Pass.Write("Lunar Eclipse: ", ct.Check_Lunar_Eclipse());
            Pass.Write("Perigee: ", ct.Check_Perigee());
            Pass.Write("Apogee: ", ct.Check_Apogee());
            Console.WriteLine();
            Console.WriteLine("***Running IsSunUp Test (This will take a minute)****");
            Console.WriteLine();
            Pass.Write("IsSunUp", ct.Check_IsSunUp());
            Console.WriteLine();
            Console.WriteLine("***Running IsMoonUp Test (This will take a minute)****");
            Console.WriteLine();
            Pass.Write("IsMoonUp", ct.Check_IsMoonUp());
            Console.WriteLine();
        }
        public static void Run_Test()
        {
            Console.WriteLine("Loading Celestial Values...");
            Console.WriteLine();
            CelestialTests ct = new CelestialTests();

            ct.Populate_CelestialTests();
            Coordinate c = new Coordinate();

            Pass.Write("Sunset: ", ct.Check_Values(ct.SunSets, "CelestialData\\SunSet.txt"));
            Pass.Write("Sunrise: ", ct.Check_Values(ct.SunRises, "CelestialData\\SunRise.txt"));
            Pass.Write("AstroDawn: ", ct.Check_Values(ct.AstroDawn, "CelestialData\\AstroDawn.txt"));
            Pass.Write("AstroDusk: ", ct.Check_Values(ct.AstroDusk, "CelestialData\\AstroDusk.txt"));
            Pass.Write("CivilDawn: ", ct.Check_Values(ct.CivilDawn, "CelestialData\\CivilDawn.txt"));
            Pass.Write("CivilDusk: ", ct.Check_Values(ct.CivilDusk, "CelestialData\\CivilDusk.txt"));
            Pass.Write("NauticalDawn: ", ct.Check_Values(ct.NauticalDawn, "CelestialData\\NauticalDawn.txt"));
            Pass.Write("NauticalDusk: ", ct.Check_Values(ct.NauticalDusk, "CelestialData\\NauticalDusk.txt"));
            Pass.Write("BottomSolarDiscRise: ", ct.Check_Values(ct.BottomSolarDiscRise, "CelestialData\\BottomDiscRise.txt"));
            Pass.Write("BottomSolarDiscSet: ", ct.Check_Values(ct.BottomSolarDiscSet, "CelestialData\\BottomDiscSet.txt"));
            Pass.Write("Moon Set: ", ct.Check_Values(ct.MoonSets, "CelestialData\\MoonSet.txt"));
            Pass.Write("Moon Rise: ", ct.Check_Values(ct.MoonRises, "CelestialData\\MoonRise.txt"));
            Console.WriteLine();
            Pass.Write("Sun Altitude: ", ct.Check_Values(ct.SunAlts, "CelestialData\\SunAlts.txt"));
            Pass.Write("Sun Azimuth: ", ct.Check_Values(ct.SunAzs, "CelestialData\\SunAzs.txt"));
            Pass.Write("Moon Altitude: ", ct.Check_Values(ct.MoonAlts, "CelestialData\\MoonAlts.txt"));
            Pass.Write("Moon Azimuth: ", ct.Check_Values(ct.MoonAzs, "CelestialData\\MoonAzs.txt"));
            Pass.Write("Moon Distance: ", ct.Check_Values(ct.MoonDistances, "CelestialData\\MoonDistance.txt"));
            Pass.Write("Moon Fraction: ", ct.Check_Values(ct.MoonFraction, "CelestialData\\MoonFraction.txt"));
            Pass.Write("Moon Phase ", ct.Check_Values(ct.MoonPhase, "CelestialData\\MoonPhase.txt"));
            Pass.Write("Moon Phase Name: ", ct.Check_Values(ct.MoonPhaseName, "CelestialData\\MoonPhaseName.txt"));
            Console.WriteLine();
            Pass.Write("Solar Eclipse: ", ct.Check_Solar_Eclipse());
            Pass.Write("Lunar Eclipse: ", ct.Check_Lunar_Eclipse());
            Pass.Write("Perigee: ", ct.Check_Perigee());
            Pass.Write("Apogee: ", ct.Check_Apogee());
            Console.WriteLine();
            Pass.Write("Local Time Conversions", ct.Check_Local_Times());
            Console.WriteLine();
            Pass.Write("Static_Last_Next_Rise_Set_Checks", ct.Check_Static_Last_Next_Times());
            Console.WriteLine();

            Console.WriteLine();

            while (true)
            {
                Console.ForegroundColor = ConsoleColor.DarkYellow;
                Console.WriteLine("Base celestial tests are completed. Do you wish to run additional \"IsUp\" tests? (Y/N)...");
                ConsoleKeyInfo key = Console.ReadKey();
                Console.ForegroundColor = ConsoleColor.White;
                if (key.Key == ConsoleKey.Y)
                {
                    break;
                }
                if (key.Key == ConsoleKey.N)
                {
                    return;
                }
                Console.WriteLine();

                Console.WriteLine("INVALID CHOICE!");
                Console.WriteLine();
            }
            Console.WriteLine();
            Console.WriteLine("***Running IsSunUp Test (This will take a minute)****");
            Console.WriteLine();
            Pass.Write("IsSunUp", ct.Check_IsSunUp());
            Console.WriteLine();
            Console.WriteLine("***Running IsMoonUp Test (This will take a minute)****");
            Console.WriteLine();
            Pass.Write("IsMoonUp", ct.Check_IsMoonUp());
            Console.WriteLine();
        }
Exemple #4
0
        static void Main(string[] args)
        {
            Console.ForegroundColor = ConsoleColor.White;

            while (true)
            {
                Console.WriteLine("Select Test Module to Run (Enter Test Number):");
                Console.WriteLine();
                Console.WriteLine("1. Coordinate Initializations");
                Console.WriteLine("2. Coordinate Conversions");
                Console.WriteLine("3. Coordinate Parsers");
                Console.WriteLine("4. Celestial");
                Console.WriteLine("5. Distance Initialization / Move Tests");
                Console.WriteLine("6. Benchmarks");
                Console.WriteLine("7. GeoFence Tests");
                Console.WriteLine("8. EagerLoading Tests");
                Console.WriteLine("ESC. Exit");
                Console.WriteLine();
                Console.Write("Select a Test Number: ");
                ConsoleKeyInfo t = Console.ReadKey();
                Console.WriteLine();
                Console.WriteLine("*********************");
                Console.WriteLine();

                if (t.Key == ConsoleKey.D1 || t.Key == ConsoleKey.NumPad1)
                {
                    Coordinate_Initialization.Run_Test();
                }
                else if (t.Key == ConsoleKey.D2 || t.Key == ConsoleKey.NumPad2)
                {
                    Coordinate_Conversion_Tests.Run_Test();
                }
                else if (t.Key == ConsoleKey.D3 || t.Key == ConsoleKey.NumPad3)
                {
                    Coordinate_Parser_Tests.Run_Test();
                }
                else if (t.Key == ConsoleKey.D4 || t.Key == ConsoleKey.NumPad4)
                {
                    CelestialTests.Run_Test();
                }
                else if (t.Key == ConsoleKey.D5 || t.Key == ConsoleKey.NumPad5)
                {
                    Distance_Tests.Run_Test();
                }
                else if (t.Key == ConsoleKey.D6 || t.Key == ConsoleKey.NumPad6)
                {
                    Benchmark_Tests.Run_Test();
                }
                else if (t.Key == ConsoleKey.D7 || t.Key == ConsoleKey.NumPad7)
                {
                    GeoFence_Tests.Run_Test();
                }
                else if (t.Key == ConsoleKey.D8 || t.Key == ConsoleKey.NumPad8)
                {
                    EagerLoading_Tests.Run_Tests();
                }
                else if (t.Key == ConsoleKey.Escape)
                {
                    return;
                }
                else
                {
                    Console.WriteLine();
                    Console.ForegroundColor = ConsoleColor.Red;
                    Console.WriteLine("Test choice invalid.");
                    Console.ForegroundColor = ConsoleColor.White;
                }

                Console.WriteLine();
                Console.WriteLine();
            }
        }