Exemple #1
0
        public void ProjectCollector_FindAllProjects()
        {
            // set up
            string givenDir = @"F:\Temp\TestProjects";

            if (Directory.Exists(givenDir))
            {
                Directory.Delete(givenDir, true);
            }
            StringCollection projects = new StringCollection();

            projects.Add(givenDir + "\\Proj0.vcxproj");
            projects.Add(givenDir + "\\Proj1\\Proj1a.vcxproj");
            projects.Add(givenDir + "\\Proj1\\Proj1b.csproj");
            projects.Add(givenDir + "\\Other\\Proj3\\Proj3.vcxproj");
            projects.Add(givenDir + "\\Other\\MyProj\\MyOtherProj.csproj");
            foreach (string prj in projects)
            {
                CreateEmptyProject(prj, "14.0");
            }
            Core.ProjectCollector pc = new Core.ProjectCollector();
            // run
            pc.ScanDirForProjects(givenDir, "*proj");
            // check pass/fail criteria
            CollectionAssert.AreEquivalent(projects, pc.projects);
            // tear down
            Directory.Delete(givenDir, true);
        }
Exemple #2
0
        public void ProjectCollector_FindOnlyVS2015Projects()
        {
            // set up
            string givenDir = @"F:\Temp\TestProjects";

            if (Directory.Exists(givenDir))
            {
                Directory.Delete(givenDir, true);
            }
            StringCollection projects = new StringCollection();

            projects.Add(Path.Combine(givenDir, "Proj2015.csproj"));
            CreateEmptyProject(Path.Combine(givenDir, "Proj2015.csproj"), "14.0");
            CreateEmptyProject(Path.Combine(givenDir, "Proj2012.csproj"), "4.0");
            Core.ProjectCollector pc = new Core.ProjectCollector();
            // run
            pc.ScanDirForProjects(givenDir, "csproj", "14.0");
            // check pass/fail criteria
            CollectionAssert.AreEquivalent(projects, pc.projects);
            // tear down
            Directory.Delete(givenDir, true);
        }