public void ClassTreeNodeImageIndex_FooTestFixtureTreeNode_ReturnsClassImageIndex()
        {
            CodeCoverageImageListIndex actual   = (CodeCoverageImageListIndex)(fooTestFixtureTreeNode.ImageIndex);
            CodeCoverageImageListIndex expected = CodeCoverageImageListIndex.Class;

            Assert.AreEqual(expected, actual);
        }
Exemple #2
0
 public CodeCoverageTreeNode(ICodeCoverageWithVisits codeCoverageWithVisits, CodeCoverageImageListIndex index)
     : this(codeCoverageWithVisits.Name,
            index,
            codeCoverageWithVisits.GetVisitedCodeLength(),
            codeCoverageWithVisits.GetUnvisitedCodeLength())
 {
 }
        public void MethodTreeNodeImageIndex_FooTestMethodTreeNode_ImageIndexIsForMethodWithZeroCodeCoverage()
        {
            CodeCoverageImageListIndex actual   = (CodeCoverageImageListIndex)(fooTestMethodTreeNode.ImageIndex);
            CodeCoverageImageListIndex expected = CodeCoverageImageListIndex.MethodWithZeroCoverage;

            Assert.AreEqual(expected, actual);
        }
		public CodeCoverageMethodsTreeNode(string name, List<CodeCoverageMethod> methods, CodeCoverageImageListIndex index) 
			: base(name, index)
		{
			this.methods = methods;
			AddDummyNodeIfHasNoMethods();
			
			int visitedCodeLength = 0;
			int unvisitedCodeLength = 0;
			decimal branchCoverage = 0;
			int branchCoverageCount = 0;
			foreach (CodeCoverageMethod method in methods) {
				if (method.Name.Contains("__")) {
					continue;
				}
				visitedCodeLength += method.GetVisitedCodeLength();
				unvisitedCodeLength += method.GetUnvisitedCodeLength();
				if ( method.IsVisited ) {
					branchCoverageCount += 1;
					branchCoverage += method.BranchCoverage == 0 ? 100 : method.BranchCoverage ;
				}
			}
			
			Name = name;
			VisitedCodeLength = visitedCodeLength;
			UnvisitedCodeLength = unvisitedCodeLength;
			VisitedBranchCoverage = branchCoverageCount == 0 ? 100 : branchCoverage/branchCoverageCount;
		}
		public CodeCoverageTreeNode(ICodeCoverageWithVisits codeCoverageWithVisits, CodeCoverageImageListIndex index)
			: this(codeCoverageWithVisits.Name,
				index,
				codeCoverageWithVisits.GetVisitedCodeLength(),
				codeCoverageWithVisits.GetUnvisitedCodeLength())
		{
		}
        public void MethodTreeNodeImageIndex_FooTestMethodVisitedCodeLengthChangedToNonZero_ImageIndexChangedToImageIndexForMethodWithNonZeroCodeCoverage()
        {
            fooTestMethodTreeNode.VisitedCodeLength = 1;
            CodeCoverageImageListIndex actual   = (CodeCoverageImageListIndex)(fooTestMethodTreeNode.ImageIndex);
            CodeCoverageImageListIndex expected = CodeCoverageImageListIndex.Method;

            Assert.AreEqual(expected, actual);
        }
Exemple #7
0
        public CodeCoverageTreeNode(string name, CodeCoverageImageListIndex index, int visitedCodeLength, int unvisitedCodeLength)
        {
            sortOrder = 10;
            this.visitedCodeLength   = visitedCodeLength;
            this.unvisitedCodeLength = unvisitedCodeLength;

            Name = name;
            SetText();

            baseImageIndex = (int)index;
            SetImageIndex();
        }
		public CodeCoverageTreeNode(string name, CodeCoverageImageListIndex index, int visitedCodeLength, int unvisitedCodeLength)
		{
			sortOrder = 10;
			this.visitedCodeLength = visitedCodeLength;
			this.unvisitedCodeLength = unvisitedCodeLength;
			
			Name = name;
			SetText();
			
			baseImageIndex = (int)index;
			SetImageIndex();
		}
		public CodeCoverageTreeNode(string name, CodeCoverageImageListIndex index, int visitedCount, int notVisitedCount)
		{
			sortOrder = 10;
			this.visitedCount = visitedCount;
			this.notVisitedCount = notVisitedCount;
			
			Name = name;
			SetText();
			
			baseImageIndex = (int)index;
			SetImageIndex();
		}
Exemple #10
0
        public CodeCoverageTreeNode(string name, CodeCoverageImageListIndex index, int visitedCount, int notVisitedCount)
        {
            sortOrder            = 10;
            this.visitedCount    = visitedCount;
            this.notVisitedCount = notVisitedCount;

            Name = name;
            SetText();

            baseImageIndex = (int)index;
            SetImageIndex();
        }
		public CodeCoverageMethodsTreeNode(string name, List<CodeCoverageMethod> methods, CodeCoverageImageListIndex index) 
			: base(name, index)
		{
			this.methods = methods;
			AddDummyNodeIfHasNoMethods();
			
			int visitedCodeLength = 0;
			int unvisitedCodeLength = 0;
			foreach (CodeCoverageMethod method in methods) {
				visitedCodeLength += method.GetVisitedCodeLength();
				unvisitedCodeLength += method.GetUnvisitedCodeLength();
			}
			
			Name = name;
			VisitedCodeLength = visitedCodeLength;
			UnvisitedCodeLength = unvisitedCodeLength;
		}
		public CodeCoverageMethodsTreeNode(string name, List<CodeCoverageMethod> methods, CodeCoverageImageListIndex index) : base(name, index)
		{
			this.methods = methods;
			if (methods.Count > 0) {
				// Add dummy node.
				Nodes.Add(new ExtTreeNode());
			}
			
			int visitedCount = 0;
			int notVisitedCount = 0;
			foreach (CodeCoverageMethod method in methods) {
				visitedCount += method.VisitedSequencePointsCount;
				notVisitedCount += method.NotVisitedSequencePointsCount;
			}
			
			Name = name;
			VisitedCount = visitedCount;
			NotVisitedCount = notVisitedCount;
		}
 public DerivedCodeCoverageTreeNode(string name, CodeCoverageImageListIndex index)
     : base(name, index)
 {
 }
Exemple #14
0
        public CodeCoverageMethodsTreeNode(string name, List <CodeCoverageMethod> methods, CodeCoverageImageListIndex index)
            : base(name, index)
        {
            this.methods = methods;
            AddDummyNodeIfHasNoMethods();

            int visitedCodeLength   = 0;
            int unvisitedCodeLength = 0;

            foreach (CodeCoverageMethod method in methods)
            {
                visitedCodeLength   += method.GetVisitedCodeLength();
                unvisitedCodeLength += method.GetUnvisitedCodeLength();
            }

            Name = name;
            VisitedCodeLength   = visitedCodeLength;
            UnvisitedCodeLength = unvisitedCodeLength;
        }
        public CodeCoverageMethodsTreeNode(string name, List <CodeCoverageMethod> methods, CodeCoverageImageListIndex index)
            : base(name, index)
        {
            this.methods = methods;
            AddDummyNodeIfHasNoMethods();

            int     visitedCodeLength   = 0;
            int     unvisitedCodeLength = 0;
            decimal branchCoverage      = 0;
            int     branchCoverageCount = 0;

            foreach (CodeCoverageMethod method in methods)
            {
                if (method.Name.Contains("__"))
                {
                    continue;
                }
                visitedCodeLength   += method.GetVisitedCodeLength();
                unvisitedCodeLength += method.GetUnvisitedCodeLength();
                if (method.IsVisited)
                {
                    branchCoverageCount += 1;
                    branchCoverage      += method.BranchCoverage == 0 ? 100 : method.BranchCoverage;
                }
            }

            Name = name;
            VisitedCodeLength     = visitedCodeLength;
            UnvisitedCodeLength   = unvisitedCodeLength;
            VisitedBranchCoverage = branchCoverageCount == 0 ? 100 : branchCoverage / branchCoverageCount;
        }
 public CodeCoverageTreeNode(string name, CodeCoverageImageListIndex index)
     : this(name, index, 0, 0, 0)
 {
 }
		public DerivedCodeCoverageTreeNode(string name, CodeCoverageImageListIndex index)
			: base(name, index)
		{
		}
Exemple #18
0
        public CodeCoverageMethodsTreeNode(string name, List <CodeCoverageMethod> methods, CodeCoverageImageListIndex index) : base(name, index)
        {
            this.methods = methods;
            if (methods.Count > 0)
            {
                // Add dummy node.
                Nodes.Add(new ExtTreeNode());
            }

            int visitedCount    = 0;
            int notVisitedCount = 0;

            foreach (CodeCoverageMethod method in methods)
            {
                visitedCount    += method.VisitedSequencePointsCount;
                notVisitedCount += method.NotVisitedSequencePointsCount;
            }

            Name            = name;
            VisitedCount    = visitedCount;
            NotVisitedCount = notVisitedCount;
        }
		public CodeCoverageTreeNode(string name, CodeCoverageImageListIndex index) 
			: this(name, index, 0, 0)
		{
		}