/// <summary>
        ///  Get function ,to get all the projects for specific vertical from data access layer.
        ///  It been used in project-list.js to show the project names on a ProjectList.html.
        /// </summary>
        /// <param name="VerticalId">VerticalId (int)index defined in the Verticals enum</param>
        /// <returns>List of Project objects in format of json</returns>
        public string GetVerticalProjects(int VerticalId)
        {
            AccessService DataAccess = new AccessService();
            var passProjectList = new List<StatusUpdatesModel.Project>();
            try {
                if (this.Session["username"].ToString() != null && DataAccess.IsUserAuthorized(this.Session["username"].ToString()))
                {
                   // AccessService DataAccess = new AccessService();
                    var VerticalProjects = DataAccess.GetAllProjectsForVertical(VerticalId);

                    foreach (StatusUpdatesModel.Project project in VerticalProjects)
                    {
                        StatusUpdatesModel.Project tempProject = new StatusUpdatesModel.Project();
                        tempProject.LatestUpdate = project.LatestUpdate;
                        tempProject.ProjectID = project.ProjectID;
                        tempProject.ProjectName = project.ProjectName;
                        passProjectList.Add(tempProject);

                    }
                }
            }
            catch (Exception)
            {
                // Probably not the best way to handle this
                string empty = JsonConvert.SerializeObject(passProjectList);
                return empty;
            }
            string result = JsonConvert.SerializeObject(passProjectList);
            return result;
        }
        /// <summary>
        /// Helper function for GetAllProjectsForVerticalTest - whatever number that gets passed in should
        /// not be between 0-8
        /// </summary>
        /// <param name="illVertNum"> Fake vertical ID which the access layer should return null</param>
        private void checkForGetAllProjectsForVerticalFailure(int illVertNum)
        {
            try
            {
                var dataAccess = new AccessService();
                List<Project> illegalVertical = dataAccess.GetAllProjectsForVertical(illVertNum);
                if ((illegalVertical != null && illegalVertical.Count > 0) && (illVertNum > 7 || illVertNum < 0))
                {
                    Assert.Fail("The vertical ID " + illVertNum + "exists and it should not!");
                }
            }
            catch (Exception e)
            {
                Assert.Fail("checkForGetAllProjectsForVerticalFailure in GetAppProjectsForVerticalAsync failed with this exception: " + e.Message);
            }

        }
        public void GetAllProjectsForVerticalTest()
        {
         var dataAccess = new AccessService();
         for (int verticalIter = -1; verticalIter < VERTICALENUM; verticalIter++)
         {
                    List<Project> allProjectsList = dataAccess.GetAllProjectsForVertical(verticalIter);

                    // Got to make sure that the data is the same
                    using (SqlConnection sqlConnection = new SqlConnection())
                    {
                        sqlConnection.ConnectionString = ConnectionString;


                        SqlCommand sqlCommand = new SqlCommand("select * from Project where VerticalID=\'" + verticalIter + "\'", sqlConnection);
                        sqlCommand.CommandTimeout = 30;


                        sqlConnection.Open();
                        SqlDataReader sqlReader = sqlCommand.ExecuteReader();
                        int sqlCount = 0;

                        while (sqlReader.Read())
                        {
                            // could make this more efficient if i knew hot to cast a sql object into a type
                            bool isProjectThere = false;
                            Project currProject = new Project();
                            currProject.ProjectID = new Guid(sqlReader["ProjectID"].ToString());
                            currProject.ProjectName = sqlReader["ProjectName"].ToString();
                            foreach (Project testProject in allProjectsList)
                            {
                                if (testProject.ProjectID.Equals(currProject.ProjectID))
                                {
                                    isProjectThere = true;
                                }
                            }

                            Assert.IsTrue(isProjectThere, "Project " + currProject.ProjectName + " does not exist in vertical " + verticalIter);
                            sqlCount++;
                        }
                        sqlConnection.Close();
                        Assert.AreEqual(sqlCount, allProjectsList.Count, "The number of projects are not equal. The database has " + sqlCount + " and the Access Service layer is returning " + allProjectsList.Count + " for vertical " + verticalIter);
                    } 

                Assert.AreNotEqual(allProjectsList, null);
                }

                // Boundary test #2: Vertical ID -2
                checkForGetAllProjectsForVerticalFailure(-2);

                // Boundary test #3: Vertical ID 8
                checkForGetAllProjectsForVerticalFailure(8);

                // Boundary test #4: Vertical ID 9
                checkForGetAllProjectsForVerticalFailure(9);

                // Random number test
                Random random = new Random();
                int randomNumber = random.Next(8, int.MaxValue);
                checkForGetAllProjectsForVerticalFailure(randomNumber);

        }