Exemple #1
0
        public void GetItemFiles()
        {
            Solution sol = TestProjectsChecks.CreateConsoleSolution("item-files");

            List <FilePath> files = sol.GetItemFiles(false).ToList();

            Assert.AreEqual(1, files.Count);
            Assert.AreEqual(sol.FileName, files [0]);

            DotNetProject p = (DotNetProject)sol.Items [0];

            files = p.GetItemFiles(false).ToList();
            Assert.AreEqual(1, files.Count);
            Assert.AreEqual(p.FileName, files [0]);

            files = p.GetItemFiles(true).ToList();
            Assert.AreEqual(6, files.Count);
            Assert.IsTrue(files.Contains(p.FileName));
            foreach (ProjectFile pf in p.Files)
            {
                Assert.IsTrue(files.Contains(pf.FilePath), "Contains " + pf.FilePath);
            }

            files = sol.GetItemFiles(true).ToList();
            Assert.AreEqual(7, files.Count);
            Assert.IsTrue(files.Contains(sol.FileName));
            Assert.IsTrue(files.Contains(p.FileName));
            foreach (ProjectFile pf in p.Files)
            {
                Assert.IsTrue(files.Contains(pf.FilePath), "Contains " + pf.FilePath);
            }

            sol.Dispose();
        }