Esempio n. 1
0
        public void ProjectCollector_ExceptionIfProjectFileMissing()
        {
            string givenDir = @"F:\Temp\TestProjects";

            if (Directory.Exists(givenDir))
            {
                Directory.Delete(givenDir, true);
            }
            string path = Path.Combine(givenDir, "Proj2015.csproj");

            Core.ProjectCollector pc = new Core.ProjectCollector();
            Directory.CreateDirectory(givenDir);
            pc.ProjectVersionMatch(path, "14.0");
        }
Esempio n. 2
0
        public void ProjectCollector_ExceptionIfProjectFileMalformed()
        {
            string givenDir = @"F:\Temp\BadProjects";

            if (Directory.Exists(givenDir))
            {
                Directory.Delete(givenDir, true);
            }
            string path = Path.Combine(givenDir, "Proj2015.csproj");

            Core.ProjectCollector pc = new Core.ProjectCollector();
            Directory.CreateDirectory(givenDir);
            using (TextWriter fs = File.CreateText(path))
                fs.Write("not a csproj");
            pc.ProjectVersionMatch(path, "14.0");
        }
Esempio n. 3
0
        public void ProjectCollector_ProjectVersionMatch()
        {
            string givenDir = @"F:\Temp\TestProjects";

            if (Directory.Exists(givenDir))
            {
                Directory.Delete(givenDir, true);
            }
            string path = Path.Combine(givenDir, "Proj2015.csproj");

            CreateEmptyProject(path, "14.0");
            Core.ProjectCollector pc = new Core.ProjectCollector();
            //
            bool res = pc.ProjectVersionMatch(path, "14.0");

            //
            Assert.IsTrue(res);
        }