public void GetDataFromNuStarWebsiteTest_MNGTS12019()
        {
            var consoleReader = new ConsoleReaderForTests("MNGT", "1", 2019, "5940");

            var nuStarDataScraper = new NuStarDataScraper();

            nuStarDataScraper.GetDataFromNuStarWebsite(consoleReader, new SaveFilePathMakerForTests());

            var filePathConstructor = new FilePathConstructorForTests();

            var tableComparer = new WorksheetTableComparerForTests(
                filePathConstructor.ConstructExcelFilePath("TestExcelFiles", "GetDataFromNuStarWebsiteTest_MNGTS12019"),
                filePathConstructor.ConstructExcelFilePath("OUTPUTFORTEST", "2019-1-5940-MNGT"),
                "2019-1-5940-MNGT");

            tableComparer.Compare();
        }
Example #2
0
        static void Main(string[] args)
        {
            //string provider = ConfigurationManager.AppSettings["provider"];
            //string connectionString = ConfigurationManager.AppSettings["connectionString"];

            //DbProviderFactory factory = DbProviderFactories.GetFactory(provider);

            //using (DbConnection connection = factory.CreateConnection())
            //{
            //    if (connection == null)
            //    {
            //        Console.WriteLine("Connection Error");
            //        Console.ReadLine();
            //        return;
            //    }

            //    connection.ConnectionString = connectionString;

            //    connection.Open();

            //    DbCommand command1 = factory.CreateCommand();

            //    if (command1 == null)
            //    {
            //        Console.WriteLine("Command Error");
            //        Console.ReadLine();
            //        return;
            //    }

            //    command1.Connection = connection;

            //    command1.CommandText = "Select * From SubjectEnrollments";

            //    using (DbDataReader dataReader = command1.ExecuteReader())
            //    {
            //        while (dataReader.Read())
            //        {
            //            Console.WriteLine($"{dataReader["CourseCode"]} " + $"{dataReader["StudentID"]}");
            //        }
            //    }
            //}

            Console.WriteLine(@"Welcome to Jess' pathway generator. This is still in dev, so if it breaks let me know.
Commands:
mp      ------ make pathway table from enrollmentdata file
prepfd  ------ prepare data for force directed diagram from pathway table
getdata ------ get data from NuStar");

            string command;

            while ((command = Console.ReadLine()) != "q")
            {
                if (command.Equals("mp"))
                {
                    var pathwayMaker = new PathwayMakerTool();
                    pathwayMaker.MakePathways(new ConsoleReader());
                }

                if (command.Equals("prepfd"))
                {
                    var forceDirectedTableMaker = new ForceDirectedTableMakerTool();
                    forceDirectedTableMaker.CreateForceDirectedTable(new ConsoleReader());
                }

                if (command.Equals("getdata"))
                {
                    var nuStarDataScraper = new NuStarDataScraper();
                    nuStarDataScraper.GetDataFromNuStarWebsite(new ConsoleReader(), new SaveFilePathMaker());
                }
            }
        }