public void TestGetAllProjects() { GetAllProjectsRequest request = new GetAllProjectsRequest(); GetAllProjectsResponse response = bal.GetAllProjects(request); Assert.IsNotNull(response); Assert.IsTrue(response.Projects.Count > 0); Assert.AreEqual(StatusCodes.Status_Success, response.StatusCode); }
public GetAllProjectsResponse GetAllProjects(GetAllProjectsRequest request) { GetAllProjectsResponse response = new GetAllProjectsResponse(); //TODO Get all folder name under BasePath string[] projectPaths = Directory.GetDirectories(ProjectBasePath); List <ProjectDomain> projects = new List <ProjectDomain>(); foreach (string projectPath in projectPaths) { // Read _DBConfig ProjectDomain projectDomain = ProjectDomainHelper.ToProjectDomain(File.ReadAllText(projectPath + "\\_Db.config")); projectDomain.ProjectName = projectPath.Replace(ProjectBasePath, ""); projects.Add(projectDomain); } response.Projects = projects.ToList(); return(response); }