public void CheckSolutionAllItemsFromFile() { string folder = AppDomain.CurrentDomain.BaseDirectory; string folders = folder + "\\..\\..\\..\\VStudio.sln"; LoadVESolution(); //dict = ReadAllProjectItemsFromFile(folders); //Microsoft.Build.Evaluation.Project pc = null; if (vs == null) { return; } Console.WriteLine("Projects " + vs.projects.Count + " have been loaded"); int c = 0; foreach (VSProject p in vs.projects) { msbuilder_alls bb = new msbuilder_alls(); TreeNode node = bb.GetProjectNode(b, p); if (node == null) { c++; continue; } //Assert.IsNotNull(node); int i = 0; { foreach (VSProjectItem pp in p.Items) { string type = pp.ItemType; string include = pp.Include; if (include.EndsWith("\\")) { include = include.Substring(0, include.Length - 1); } TreeNode ng = bb.FindNodesIncludes(node, include); if (ng == null) { Console.WriteLine("Error: " + p.FileName); Console.WriteLine("Type: " + pp.ItemType); Console.WriteLine("Include: " + pp.Include); Assert.IsNotNull(ng); } if (ng != null) { i++; } c++; } } Console.WriteLine("Projects " + p.Name + " - " + i.ToString() + " items have been checked"); } Console.WriteLine("Test results: " + "Projects " + c.ToString() + " have been checked"); }
public void CheckSolutionFormSubtypes() { LoadVESolution(); Microsoft.Build.Evaluation.Project pc = null; if (vs == null) { return; } int c = 0; foreach (VSProject p in vs.projects) { pc = (Microsoft.Build.Evaluation.Project)p.LoadProjectToMemory(); if (pc == null) { continue; } this.GetSubTypes(pc, p); msbuilder_alls bb = new msbuilder_alls(); TreeNode node = bb.GetProjectNode(b, p); Assert.IsNotNull(node); int i = 0; foreach (string s in dict.Keys) { ArrayList L = dict[s]; foreach (Microsoft.Build.Evaluation.ProjectItem pp in L) { string type = pp.ItemType; string include = pp.EvaluatedInclude; TreeNode ng = bb.FindNodesIncludes(node, include); Assert.IsNotNull(ng); if (ng != null) { i++; } c++; } } Console.WriteLine("Projects " + p.Name + " - " + i.ToString() + " items have been checked"); } Console.WriteLine("Test results\\n" + "Projects " + c.ToString() + " have been checked"); // TestContext.WriteLine("Projects " + c.ToString() + " have been checked" ); }
public void CheckSolution() { Microsoft.Build.Evaluation.Project pc = null; if (vs == null) { return; } foreach (VSProject p in vs.projects) { pc = p.LoadProjectToMemory(); GetSubTypes(pc, p); msbuilder_alls bb = new msbuilder_alls(); TreeNode node = bb.GetProjectNode(b, p); Assert.That(node, Is.Not.Null); int i = 0; foreach (string s in dict.Keys) { ArrayList L = dict[s]; foreach (Microsoft.Build.Evaluation.ProjectItem pp in L) { string type = pp.ItemType; string include = pp.EvaluatedInclude; TreeNode ng = bb.FindNodesIncludes(node, include); Assert.That(ng, Is.Not.Null); if (ng != null) { i++; } } } } }