Exemplo n.º 1
0
        private void toolStripButton9_Click(object sender, EventArgs e)
        {
            TreeNode d = ns.SelectedNode;

            msbuilder_alls b = new msbuilder_alls();

            int N = dg.Rows.Count;

            int i = 0;

            foreach (DataGridViewRow r in dg.Rows)
            {
                string type    = r.Cells[0].Value as string;
                string include = r.Cells[1].Value as string;
                if (include == null)
                {
                    continue;
                }

                TreeNode ng = b.FindNodesIncludes(d, include);

                if (ng == null)
                {
                    MessageBox.Show("Node has not been found - " + d.Text);
                }
                else
                {
                    i++;
                }
            }

            MessageBox.Show("Total nodes " + i.ToString() + " from existing " + N.ToString() + " have been found");
        }
Exemplo n.º 2
0
        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");
        }
Exemplo n.º 3
0
        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" );
        }
Exemplo n.º 4
0
        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++;
                        }
                    }
                }
            }
        }
Exemplo n.º 5
0
        private void Dg_SelectionChanged(object sender, EventArgs e)
        {
            if (dg.SelectedRows == null)
            {
                return;
            }
            if (dg.SelectedRows.Count <= 0)
            {
                return;
            }
            DataGridViewRow r = dg.SelectedRows[0];

            string type    = r.Cells[0].Value as string;
            string include = r.Cells[1].Value as string;

            if (include == null)
            {
                return;
            }

            msbuilder_alls b = new msbuilder_alls();

            TreeNode d = ns.SelectedNode;

            if (pg != null)
            {
                pg.SelectedObject = d.Tag;
            }

            TreeNode ng = b.FindNodesIncludes(d, include);

            if (ng == null)
            {
                return;
            }
            MessageBox.Show("Node found - " + ng.Text);
        }