public bool SuppressUsageInspectionsOnElement(IDeclaredElement element, out ImplicitUseKindFlags flags)
 {
     flags = 0;
     var suppress = element.IsAnyUnitTestElement();
     if (suppress)
         flags = ImplicitUseKindFlags.Default;
     return suppress;
 }
        // Used to discover the type of the element - unknown, test, test container (class) or
        // something else relating to a test element (e.g. parent class of a nested test class)
        // This method is called to get the icon for the completion lists, amongst other things
        public bool IsElementOfKind(IDeclaredElement declaredElement, UnitTestElementKind elementKind)
        {
            switch (elementKind)
            {
            case UnitTestElementKind.Unknown:
                return(!declaredElement.IsAnyUnitTestElement());

            case UnitTestElementKind.Test:
                return(declaredElement.IsUnitTest());

            case UnitTestElementKind.TestContainer:
                return(declaredElement.IsUnitTestContainer());

            case UnitTestElementKind.TestStuff:
                return(declaredElement.IsAnyUnitTestElement());
            }

            return(false);
        }
        // Used to discover the type of the element - unknown, test, test container (class) or
        // something else relating to a test element (e.g. parent class of a nested test class)
        // This method is called to get the icon for the completion lists, amongst other things
        public bool IsElementOfKind(IDeclaredElement declaredElement, UnitTestElementKind elementKind)
        {
            switch (elementKind)
            {
                case UnitTestElementKind.Unknown:
                    return !declaredElement.IsAnyUnitTestElement();

                case UnitTestElementKind.Test:
                    return declaredElement.IsUnitTest();

                case UnitTestElementKind.TestContainer:
                    return declaredElement.IsUnitTestContainer();

                case UnitTestElementKind.TestStuff:
                    return declaredElement.IsAnyUnitTestElement();
            }

            return false;
        }
Exemple #4
0
        public bool SuppressUsageInspectionsOnElement(IDeclaredElement element, out ImplicitUseKindFlags flags)
        {
            flags = 0;
            var suppress = element.IsAnyUnitTestElement();

            if (suppress)
            {
                flags = ImplicitUseKindFlags.Default;
            }
            return(suppress);
        }
        public bool SupressUsageInspectionsOnElement(IDeclaredElement element, out ImplicitUseKindFlags flags)
        {
            // TODO: Check that we're returning the right flags here
            // Should use IUKF.Access for the property identified by DataPropertyAttribute?
            // Should also require ImplicitUseKindTargets passed in?
            // Are there enough flags to indicate all that we need?
            // e.g. How do we indicate methods being called implicitly? Constructors?
            flags = 0;
            var suppress = element.IsAnyUnitTestElement();

            if (suppress)
            {
                flags = ImplicitUseKindFlags.Default;
            }
            return(suppress);
        }