Esempio n. 1
0
            public bool IsElementOfKind(UnitTestElement element, UnitTestElementKind kind)
            {
                if (element == null)
                {
                    throw new ArgumentNullException("element");
                }

                GallioTestElement gallioTestElement = element as GallioTestElement;

                if (gallioTestElement == null)
                {
                    return(false);
                }

                switch (kind)
                {
                case UnitTestElementKind.Unknown:
                case UnitTestElementKind.TestStuff:
                    return(false);

                case UnitTestElementKind.Test:
                    return(gallioTestElement.IsTestCase);

                case UnitTestElementKind.TestContainer:
                    return(!gallioTestElement.IsTestCase);

                default:
                    throw new ArgumentOutOfRangeException("kind");
                }
            }
Esempio n. 2
0
            public bool IsElementOfKind(IDeclaredElement element, UnitTestElementKind kind)
            {
                if (element == null)
                {
                    throw new ArgumentNullException("element");
                }
                return(EvalTestPartPredicate(element, testPart =>
                {
                    switch (kind)
                    {
                    case UnitTestElementKind.Unknown:
                        return false;

                    case UnitTestElementKind.Test:
                        return testPart.IsTest;

                    case UnitTestElementKind.TestContainer:
                        return testPart.IsTestContainer;

                    case UnitTestElementKind.TestStuff:
                        return testPart.IsTestContribution;

                    default:
                        throw new ArgumentOutOfRangeException("kind");
                    }
                }));
            }
        public bool IsOfKind(UnitTestElement element, UnitTestElementKind elementKind)
        {
            if (element is StorEvilScenarioElement)
                return elementKind == UnitTestElementKind.Test;

            if (element is StorEvilStoryElement || element is StorEvilProjectElement)
                return elementKind == UnitTestElementKind.TestContainer;

            return false;
        }
Esempio n. 4
0
        public bool IsElementOfKind(IUnitTestElement element, UnitTestElementKind elementKind)
        {
            var declaredElement = element.GetDeclaredElement();

            if (declaredElement == null)
            {
                return(false);
            }

            return(IsElementOfKind(declaredElement, elementKind));
        }
 public bool IsElementOfKind(IUnitTestElement element, UnitTestElementKind elementKind)
 {
     switch (elementKind)
     {
         case UnitTestElementKind.Test:
             return element is SpecificationElement;
         case UnitTestElementKind.TestContainer:
             return element is SpecificationContainerElement;
         default:
             return false;
     }
 }
        public bool IsElementOfKind(UnitTestElement element, UnitTestElementKind elementKind)
        {
            switch (elementKind)
            {
            case UnitTestElementKind.Test:
                return(element is ContextSpecificationElement);

            case UnitTestElementKind.TestContainer:
                return(element is ContextElement || element is BehaviorElement);
            }

            return(false);
        }
        public bool IsElementOfKind(IDeclaredElement declaredElement, UnitTestElementKind elementKind)
        {
            switch (elementKind)
            {
            case UnitTestElementKind.Test:
                return(declaredElement.IsSpecification());

            case UnitTestElementKind.TestContainer:
                return(declaredElement.IsContext() || declaredElement.IsBehavior());
            }

            return(false);
        }
Esempio n. 8
0
        public bool IsOfKind(UnitTestElement element, UnitTestElementKind elementKind)
        {
            if (element is StorEvilScenarioElement)
            {
                return(elementKind == UnitTestElementKind.Test);
            }

            if (element is StorEvilStoryElement || element is StorEvilProjectElement || element is StorEvilScenarioOutlineElement)
            {
                return(elementKind == UnitTestElementKind.TestContainer);
            }

            return(false);
        }
    public bool IsElementOfKind(IDeclaredElement declaredElement, UnitTestElementKind elementKind)
    {
      switch (elementKind)
      {
        case UnitTestElementKind.Test:
          return declaredElement.IsSpecification();
        case UnitTestElementKind.TestContainer:
          return declaredElement.IsContext() || declaredElement.IsBehavior();
        case UnitTestElementKind.TestStuff:
          return declaredElement.IsSpecification() || declaredElement.IsContext() || declaredElement.IsBehavior();
        case UnitTestElementKind.Unknown:
          return !(declaredElement.IsSpecification() || declaredElement.IsContext() || declaredElement.IsBehavior());
      }

      return false;
    }
Esempio n. 10
0
        public bool IsElementOfKind([NotNull] IDeclaredElement declaredElement, UnitTestElementKind elementKind)
        {
            var clazz = declaredElement as ITypeElement;

            if (clazz == null)
            {
                var member = declaredElement as ITypeMember;
                if (member == null)
                {
                    return(false);
                }

                clazz = member.GetContainingType().NotNull();
            }

            return(clazz.GetAttributeData <SuiteAttributeBase>() != null);
        }
    public bool IsElementOfKind(IUnitTestElement element, UnitTestElementKind elementKind)
    {
      switch (elementKind)
      {
        case UnitTestElementKind.Test:
          return element is ContextSpecificationElement || element is BehaviorSpecificationElement;
        case UnitTestElementKind.TestContainer:
          return element is ContextElement || element is BehaviorElement;
        case UnitTestElementKind.TestStuff:
          return element is ContextSpecificationElement || element is BehaviorSpecificationElement ||
                 element is ContextElement || element is BehaviorElement;
        case UnitTestElementKind.Unknown:
          return !(element is ContextSpecificationElement || element is BehaviorSpecificationElement ||
                   element is ContextElement || element is BehaviorElement);
      }

      return false;
    }
Esempio n. 12
0
        public bool IsElementOfKind(IUnitTestElement element, UnitTestElementKind elementKind)
        {
            switch (elementKind)
            {
            case UnitTestElementKind.Unknown:
                return(!(element is JasmineSpecificationElement) && !(element is JasmineSuiteElement));

            case UnitTestElementKind.Test:
                return(element is JasmineSpecificationElement);

            case UnitTestElementKind.TestContainer:
                return(element is JasmineSuiteElement);

            case UnitTestElementKind.TestStuff:
                return(element is JasmineSpecificationElement || element is JasmineSuiteElement);
            }
            throw new ArgumentOutOfRangeException("elementKind");
        }
Esempio n. 13
0
        // 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);
        }
Esempio n. 14
0
        public bool IsElementOfKind(IUnitTestElement element, UnitTestElementKind elementKind)
        {
            switch (elementKind)
            {
            case UnitTestElementKind.Unknown:
                return(!(element is BaseElement));

            case UnitTestElementKind.Test:
                return((element is TestMethodElement && !((TestMethodElement)element).IsParameterized) || element is TestCaseElement);

            case UnitTestElementKind.TestContainer:
                return(element is TestClassElement || (element is TestMethodElement && ((TestMethodElement)element).IsParameterized));

            case UnitTestElementKind.TestStuff:
                return(element is TestClassElement);
            }

            return(false);
        }
Esempio n. 15
0
        public bool IsElementOfKind(IUnitTestElement element, UnitTestElementKind elementKind)
        {
            switch (elementKind)
            {
            case UnitTestElementKind.Unknown:
                return(!(element is XunitTestMethodElement || element is XunitTestClassElement || element is XunitTestTheoryElement));

            case UnitTestElementKind.Test:
                return((element is XunitTestMethodElement && !element.Children.Any()) || element is XunitTestTheoryElement);

            case UnitTestElementKind.TestContainer:
                return(element is XunitTestClassElement || element is XunitInheritedTestMethodContainerElement || (element is XunitTestMethodElement && element.Children.Any()));

            case UnitTestElementKind.TestStuff:
                return(element is XunitTestMethodElement || element is XunitTestClassElement || element is XunitInheritedTestMethodContainerElement || element is XunitTestTheoryElement);
            }

            return(false);
        }
        public bool IsElementOfKind(IUnitTestElement element, UnitTestElementKind elementKind)
        {
            switch (elementKind)
            {
                case UnitTestElementKind.Unknown:
                    return !(element is XunitTestMethodElement || element is XunitTestClassElement || element is XunitTestTheoryElement);

                case UnitTestElementKind.Test:
                    return (element is XunitTestMethodElement && !element.Children.Any()) || element is XunitTestTheoryElement;

                case UnitTestElementKind.TestContainer:
                    return element is XunitTestClassElement || element is XunitInheritedTestMethodContainerElement || (element is XunitTestMethodElement && element.Children.Any());

                case UnitTestElementKind.TestStuff:
                    return element is XunitTestMethodElement || element is XunitTestClassElement || element is XunitInheritedTestMethodContainerElement || element is XunitTestTheoryElement;
            }

            return false;
        }
        public bool IsElementOfKind(IDeclaredElement declaredElement, UnitTestElementKind elementKind)
        {
            switch (elementKind)
            {
                case UnitTestElementKind.Unknown:
                    return !UnitTestElementPsiIdentifier.IsAnyUnitTestElement(declaredElement);

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

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

                case UnitTestElementKind.TestStuff:
                    return UnitTestElementPsiIdentifier.IsUnitTestStuff(declaredElement);
            }

            return false;
        }
        public bool IsElementOfKind(IUnitTestElement element, UnitTestElementKind elementKind)
        {
            switch (elementKind)
            {
                case UnitTestElementKind.Unknown:
                    return !(element is XunitTestElementBase);

                case UnitTestElementKind.Test:
                    return element is XunitTestMethodElement;

                case UnitTestElementKind.TestContainer:
                    return element is XunitTestClassElement;

                case UnitTestElementKind.TestStuff:
                    return element is XunitTestElementBase;
            }

            return false;
        }
Esempio n. 19
0
        public bool IsElementOfKind(IDeclaredElement declaredElement, UnitTestElementKind elementKind)
        {
            switch (elementKind)
            {
            case UnitTestElementKind.Unknown:
                return(!IsUnitTestStuff(declaredElement));

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

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

            case UnitTestElementKind.TestStuff:
                return(IsUnitTestStuff(declaredElement));

            default:
                throw new ArgumentOutOfRangeException("elementKind");
            }
        }
Esempio n. 20
0
        public bool IsElementOfKind(UnitTestElement element, UnitTestElementKind elementKind)
        {
            switch (elementKind)
            {
            case UnitTestElementKind.Unknown:
                return(!(element is CSUnitElementBase));

            case UnitTestElementKind.Test:
                return(element is CSUnitTestElement);

            case UnitTestElementKind.TestContainer:
                return(element is CSUnitTestFixtureElement);

            case UnitTestElementKind.TestStuff:
                return(element is CSUnitElementBase);

            default:
                throw new ArgumentOutOfRangeException("elementKind");
            }
        }
Esempio n. 21
0
        public bool IsElementOfKind(IUnitTestElement element, UnitTestElementKind elementKind)
        {
            switch (elementKind)
            {
            case UnitTestElementKind.Test:
                return(element is MspecSpecificationTestElement or MspecBehaviorSpecificationTestElement);

            case UnitTestElementKind.TestContainer:
                return(element is MspecContextTestElement);

            case UnitTestElementKind.TestStuff:
                return(element is MspecContextTestElement or MspecSpecificationTestElement or MspecBehaviorSpecificationTestElement);

            case UnitTestElementKind.Unknown:
                return(element is not MspecContextTestElement &&
                       element is not MspecSpecificationTestElement &&
                       element is not MspecBehaviorSpecificationTestElement);
            }

            return(false);
        }
Esempio n. 22
0
        public bool IsElementOfKind(IDeclaredElement declaredElement, UnitTestElementKind elementKind)
        {
            var isClass  = declaredElement is ITypeElement;
            var isMethod = declaredElement is IFunction;

            switch (elementKind)
            {
            case UnitTestElementKind.Unknown:
                return(!isClass && !isMethod);

            case UnitTestElementKind.Test:
                return(isMethod && !isClass);

            case UnitTestElementKind.TestContainer:
                return(isClass);

            case UnitTestElementKind.TestStuff:
                return(isClass);

            default:
                throw new ArgumentOutOfRangeException(nameof(elementKind), elementKind, null);
            }
        }
Esempio n. 23
0
 public bool IsElementOfKind(IUnitTestElement element, UnitTestElementKind elementKind)
 {
     var testElement = element as ITestElement;
       return testElement != null && testElement.ElementKind == elementKind;
 }
Esempio n. 24
0
 public bool IsElementOfKind(IUnitTestElement element, UnitTestElementKind elementKind)
 {
     return(myNUnitTestProvider.IsElementOfKind(element, elementKind));
 }
Esempio n. 25
0
        public bool IsElementOfKind(IUnitTestElement element, UnitTestElementKind elementKind)
        {
            switch (elementKind)
            {
                case UnitTestElementKind.Unknown:
                    return !(element is JasmineSpecificationElement) && !(element is JasmineSuiteElement);

                case UnitTestElementKind.Test:
                    return element is JasmineSpecificationElement;

                case UnitTestElementKind.TestContainer:
                    return element is JasmineSuiteElement;

                case UnitTestElementKind.TestStuff:
                    return element is JasmineSpecificationElement || element is JasmineSuiteElement;
            }
            throw new ArgumentOutOfRangeException("elementKind");
        }
Esempio n. 26
0
    public bool IsElementOfKind(IDeclaredElement declaredElement, UnitTestElementKind elementKind)
    {
      switch (elementKind)
      {
        case UnitTestElementKind.Test:
          return declaredElement.IsSpecification();
        case UnitTestElementKind.TestContainer:
          return declaredElement.IsContext();
      }

      return false;
    }
Esempio n. 27
0
 public bool IsElementOfKind(IUnitTestElement element, UnitTestElementKind elementKind)
 {
     return(false);
 }
Esempio n. 28
0
    public bool IsElementOfKind(UnitTestElement element, UnitTestElementKind elementKind)
    {
      switch (elementKind)
      {
        case UnitTestElementKind.Test:
          return element is ContextSpecificationElement;
        case UnitTestElementKind.TestContainer:
          return element is ContextElement;
      }

      return false;
    }
 public bool IsElementOfKind(IUnitTestElement element, UnitTestElementKind elementKind)
 {
     return false;
 }
Esempio n. 30
0
        public bool IsElementOfKind(IDeclaredElement declaredElement, UnitTestElementKind elementKind)
        {
            var clazz = declaredElement as ITypeElement;
              if (clazz == null)
              {
            var member = declaredElement as ITypeMember;
            if (member == null)
              return false;

            clazz = member.GetContainingType();
              }

              return clazz.GetAttributeData<SuiteAttributeBase>() != null;
        }
Esempio n. 31
0
 public bool IsElementOfKind(IUnitTestElement element, UnitTestElementKind elementKind)
 {
     throw new NotImplementedException();
 }
Esempio n. 32
0
 public bool IsElementOfKind(IDeclaredElement declaredElement, UnitTestElementKind elementKind)
 {
     return _comparer.IsDeclaredElementOfKind(declaredElement, elementKind);
 }
Esempio n. 33
0
 public bool IsElementOfKind(IDeclaredElement element, UnitTestElementKind kind)
 {
     if (element == null)
         throw new ArgumentNullException("element");
     return EvalTestPartPredicate(element, testPart =>
     {
         switch (kind)
         {
             case UnitTestElementKind.Unknown:
                 return false;
             case UnitTestElementKind.Test:
                 return testPart.IsTest;
             case UnitTestElementKind.TestContainer:
                 return testPart.IsTestContainer;
             case UnitTestElementKind.TestStuff:
                 return testPart.IsTestContribution;
             default:
                 throw new ArgumentOutOfRangeException("kind");
         }
     });
 }
Esempio n. 34
0
 public bool IsElementOfKind(IDeclaredElement declaredElement, UnitTestElementKind elementKind)
 {
     return(myNUnitTestProvider.IsElementOfKind(declaredElement, elementKind));
 }
 public bool IsElementOfKind(IDeclaredElement declaredElement, UnitTestElementKind elementKind)
 {
     throw new System.NotImplementedException();
 }
 public bool IsElementOfKind(IDeclaredElement declaredElement, UnitTestElementKind elementKind)
 {
     //This never seems to get called, and by experiment I see no adverse effect of not implementing it.
     return false;
 }
Esempio n. 37
0
 public bool IsElementOfKind(IDeclaredElement declaredElement, UnitTestElementKind elementKind)
 {
     return(_comparer.IsDeclaredElementOfKind(declaredElement, elementKind));
 }
Esempio n. 38
0
 public bool IsElementOfKind(UnitTestElement element, UnitTestElementKind kind)
 {
     return shim.IsElementOfKind(element, kind);
 }
Esempio n. 39
0
 public bool IsElementOfKind(IUnitTestElement element, UnitTestElementKind elementKind)
 {
     throw new NotImplementedException();
 }
Esempio n. 40
0
            public bool IsElementOfKind(UnitTestElement element, UnitTestElementKind kind)
            {
                if (element == null)
                    throw new ArgumentNullException("element");

                GallioTestElement gallioTestElement = element as GallioTestElement;
                if (gallioTestElement == null)
                    return false;

                switch (kind)
                {
                    case UnitTestElementKind.Unknown:
                    case UnitTestElementKind.TestStuff:
                        return false;
                    case UnitTestElementKind.Test:
                        return gallioTestElement.IsTestCase;
                    case UnitTestElementKind.TestContainer:
                        return ! gallioTestElement.IsTestCase;
                    default:
                        throw new ArgumentOutOfRangeException("kind");
                }
            }
Esempio n. 41
0
 public bool IsElementOfKind(UnitTestElement element, UnitTestElementKind elementKind)
 {
     return(_comparer.IsOfKind(element, elementKind));
 }
Esempio n. 42
0
 public bool IsElementOfKind(UnitTestElement element, UnitTestElementKind elementKind)
 {
     return _comparer.IsOfKind(element, elementKind);
 }
Esempio n. 43
0
        public bool IsElementOfKind([NotNull] IUnitTestElement element, UnitTestElementKind elementKind)
        {
            var testElement = element as ITestElement;

            return(testElement != null && testElement.ElementKind == elementKind);
        }
 public bool IsElementOfKind(IDeclaredElement declaredElement, UnitTestElementKind elementKind)
 {
     return false;
 }
Esempio n. 45
0
 public bool IsElementOfKind(IDeclaredElement declaredElement, UnitTestElementKind elementKind)
 {
     return(false);
 }
Esempio n. 46
0
 public bool IsElementOfKind(UnitTestElement element, UnitTestElementKind kind)
 {
     return(shim.IsElementOfKind(element, kind));
 }
        public bool IsElementOfKind(IUnitTestElement element, UnitTestElementKind elementKind)
        {
            switch (elementKind)
            {
                case UnitTestElementKind.Unknown:
                    return !(element is BaseElement);

                case UnitTestElementKind.Test:
                    return (element is TestMethodElement  && !((TestMethodElement)element).IsParameterized) || element is TestCaseElement;

                case UnitTestElementKind.TestContainer:
                    return element is TestClassElement|| (element is TestMethodElement && ((TestMethodElement)element).IsParameterized);

                case UnitTestElementKind.TestStuff:
                    return element is TestClassElement;
            }

            return false;
        }
Esempio n. 48
0
 public bool IsElementOfKind(IUnitTestElement element, UnitTestElementKind elementKind)
 {
     throw new NotImplementedException("It seems this method is used after all, please tell the NBehave team what you did to trigger this exception");
 }
Esempio n. 49
0
 public bool IsElementOfKind(IUnitTestElement element, UnitTestElementKind elementKind)
 {
     throw new NotImplementedException("It seems this method is used after all, please tell the NBehave team what you did to trigger this exception");
 }