コード例 #1
0
        private bool IsElementAcceptableType(VCCodeElement element)
        {
            switch (element.Kind)
            {
            case vsCMElement.vsCMElementFunction:
                VCCodeFunction function = (VCCodeFunction)element;

                if (element.Name.StartsWith("~") ||
                    function.Access != vsCMAccess.vsCMAccessPublic)
                {
                    return(false);
                }
                else
                {
                    return(true);
                }

            case vsCMElement.vsCMElementClass:
                VCCodeClass klass = (VCCodeClass)element;

                if (klass.Access != vsCMAccess.vsCMAccessPublic)
                {
                    return(false);
                }
                else
                {
                    return(true);
                }

            case vsCMElement.vsCMElementNamespace:
                return(true);

            case vsCMElement.vsCMElementStruct:
                VCCodeStruct strukt = (VCCodeStruct)element;

                if (strukt.Access != vsCMAccess.vsCMAccessPublic)
                {
                    return(false);
                }
                else
                {
                    return(true);
                }

            default:
                return(false);
            }
        }
コード例 #2
0
        private bool IsStructTestSuite(VCCodeStruct strukt)
        {
            foreach (VCCodeElement element in strukt.Bases)
            {
                if (Constants.CxxTestSuiteClassRegex.IsMatch(element.Name))
                {
                    currentSuite = new TestSuite(strukt);
                    testSuites.Add(currentSuite);

                    ProjectItem item = strukt.ProjectItem;
                    if (item != null)
                    {
                        RemovePossibleTestFile(item);
                    }

                    return(true);
                }
            }

            return(false);
        }
コード例 #3
0
        // ------------------------------------------------------
        /// <summary>
        /// Creates a new test suite based on the specified struct in the VC
        /// code model.
        /// </summary>
        /// <param name="testClass">
        /// The VC code model struct object from which to create the test
        /// suite.
        /// </param>
        public TestSuite(VCCodeStruct testClass)
        {
            this.testClass = (VCCodeElement)testClass;

            Initialize();
        }
コード例 #4
0
        private bool IsStructTestSuite(VCCodeStruct strukt)
        {
            foreach (VCCodeElement element in strukt.Bases)
            {
                if (Constants.CxxTestSuiteClassRegex.IsMatch(element.Name))
                {
                    currentSuite = new TestSuite(strukt);
                    testSuites.Add(currentSuite);

                    ProjectItem item = strukt.ProjectItem;
                    if (item != null)
                        RemovePossibleTestFile(item);

                    return true;
                }
            }

            return false;
        }