Beispiel #1
0
        private UnitTestElementLocation GetUnitTestElementLocation(ITestDeclaration declaration)
        {
            var ranges = declaration.GetRanges();

            return(new UnitTestElementLocation(
                       declaration.GetSourceFile().ToProjectFile(),
                       ranges.NavigationRange.TextRange,
                       ranges.ContainingRange.TextRange));
        }
        public Ranges GetRanges(ITestDeclaration declaration)
        {
            if (declaration is IClassDeclaration)
            return GetUnitTestElementLocation((IClassDeclaration) declaration);
              if (declaration is IExpressionStatement)
            return GetUnitTestElementLocation((IExpressionStatement) declaration);
              if (declaration is IInvocationExpression)
            return GetUnitTestElementLocation((IInvocationExpression) declaration);

              throw new Exception();
        }
Beispiel #3
0
        public Ranges GetRanges(ITestDeclaration declaration)
        {
            if (declaration is IDeclaration)
            {
                return(GetUnitTestElementLocation((IDeclaration)declaration));
            }
            if (declaration is IExpressionStatement)
            {
                return(GetUnitTestElementLocation((IExpressionStatement)declaration));
            }
            if (declaration is IInvocationExpression)
            {
                return(GetUnitTestElementLocation((IInvocationExpression)declaration));
            }

            throw new Exception();
        }
        public UnitTestElementLocation GetTestElementLocation(ITestDeclaration declaration)
        {
            if (declaration is IClassDeclaration)
            {
                return(GetUnitTestElementLocation((IClassDeclaration)declaration));
            }
            if (declaration is IExpressionStatement)
            {
                return(GetUnitTestElementLocation((IExpressionStatement)declaration));
            }
            if (declaration is IInvocationExpression)
            {
                return(GetUnitTestElementLocation((IInvocationExpression)declaration));
            }

            throw new Exception();
        }
 public static UnitTestElementLocation GetTestElementLocation(this ITestDeclaration declaration)
 {
     return(UnitTestDeclarationUtility.Instance.GetTestElementLocation(declaration));
 }
Beispiel #6
0
 public NoDefaultTestHighlighting(ITestDeclaration treeNode)
     : base(treeNode, Message)
 {
 }
Beispiel #7
0
 public DuplicatedTestHighlighting(ITestDeclaration treeNode)
     : base(treeNode, Message)
 {
 }
Beispiel #8
0
 private UnitTestElementLocation GetUnitTestElementLocation(ITestDeclaration declaration)
 {
     var ranges = declaration.GetRanges();
       return new UnitTestElementLocation(
       declaration.GetSourceFile().ToProjectFile(),
       ranges.NavigationRange.TextRange,
       ranges.ContainingRange.TextRange);
 }
Beispiel #9
0
 public static Ranges GetRanges(this ITestDeclaration declaration)
 {
     return(TestDeclarationUtility.Instance.GetRanges(declaration));
 }
Beispiel #10
0
 protected SimpleTestDeclarationHighlightingBase(ITestDeclaration treeNode, [NotNull] string toolTipText)
 {
     _treeNode    = treeNode;
     _toolTipText = toolTipText;
 }
 public DuplicatedTestHighlighting(ITestDeclaration treeNode)
     : base(treeNode, Message)
 {
 }
 protected SimpleTestDeclarationHighlightingBase(ITestDeclaration treeNode, [NotNull] string toolTipText)
 {
     _treeNode = treeNode;
       _toolTipText = toolTipText;
 }
 public NoDefaultTestHighlighting(ITestDeclaration treeNode)
     : base(treeNode, Message)
 {
 }