public void GeneratePathwaysForListOfStudentsFromEnrollmentData(ConsoleReaderForTests consoleReader)
        {
            var pathwayMakerTool = new PathwayMakerTool();

            pathwayMakerTool.MakePathways(consoleReader);

            var tableComparer = new WorksheetTableComparerForTests(consoleReader.GetTestFilePath(), consoleReader.GetNewSaveFilePath(), consoleReader.GetWorksheetName());

            tableComparer.Compare();
            //var rowCount = 2;
            //while (rowCount <= (testFile as Worksheet).UsedRange.Rows.Count)
            //{
            //    var colCount = 2;
            //    while (colCount <= (testFile as Worksheet).UsedRange.Columns.Count)
            //    {
            //        Assert.AreEqual((((testFile as Worksheet).Cells[rowCount, colCount] as Range).Value as string)?.Trim(),
            //            (((outputFile as Worksheet).Cells[rowCount, colCount] as Range).Value as string)?.Trim(),
            //            String.Format("Pathways didn't match. Student: {0} Semester {1}, {2}",
            //                    ((testFile as Worksheet).Cells[rowCount, 1] as Range).Value.ToString(),
            //                    ((testFile as Worksheet).Cells[2, colCount] as Range).Value.ToString(),
            //                    ((testFile as Worksheet).Cells[1, colCount] as Range).Value.ToString()));
            //        colCount++;
            //    }
            //    rowCount++;
            //}



            //}
            //catch (Exception ex)
            //{
            //    outputWorkbook.Close();
            //    app.Quit();
            //    System.Runtime.InteropServices.Marshal.ReleaseComObject(outputFile);
            //    System.Runtime.InteropServices.Marshal.ReleaseComObject(outputWorkbook);
            //    System.IO.File.Delete(consoleReader.GetNewSaveFilePath());
            //    throw;
            //}
        }
Exemplo n.º 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());
                }
            }
        }