Skip to content
This repository was archived by the owner on Oct 16, 2020. It is now read-only.

Commit 275d7a9

Browse files
author
Dragan
committed
CodeCoverage: Tests
1 parent 6880262 commit 275d7a9

4 files changed

Lines changed: 26 additions & 24 deletions

File tree

src/AddIns/Analysis/CodeCoverage/Test/Coverage/CodeCoverageResultsMissingFileIdTestFixture.cs

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -111,14 +111,6 @@ public void ModulesName_SecondModuleNameReadFromResults_IsMyTestsAssembly()
111111
Assert.AreEqual(expectedName, name);
112112
}
113113

114-
[Test, Ignore("Replaced by test below")]
115-
public void SequencePointsCount_NUnitNotEqualAssertFailMethod_ReturnsAllSequencePoints()
116-
{
117-
int sequencePointCount = FirstModuleFirstMethod.SequencePoints.Count;
118-
int expectedSequencePointCount = 3;
119-
Assert.AreEqual(expectedSequencePointCount, sequencePointCount);
120-
}
121-
122114
/// <summary> No method.FileID => No sequence points!
123115
/// SD.CodeCoverage DOES NOT RETURN SequencePoints
124116
/// for assemblies without debug info,

src/AddIns/Analysis/CodeCoverage/Test/Coverage/CodeCoverageResultsTestFixture.cs

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ public void SetUpFixture()
3636
"\t\t\t<FullName>C:\\Projects\\Test\\Foo.Tests\\bin\\Foo.Tests.DLL</FullName>\r\n" +
3737
"\t\t\t<ModuleName>Foo.Tests</ModuleName>\r\n" +
3838
"\t\t\t<Files>\r\n" +
39-
"\t\t\t\t<File uid=\"1\" fullPath=\"c:\\Projects\\Foo\\FooTestFixture.cs\" />\r\n" +
39+
"\t\t\t\t<File uid=\"2\" fullPath=\"c:\\Projects\\Foo\\FooTestFixture.cs\" />\r\n" +
4040
"\t\t\t</Files>\r\n" +
4141
"\t\t\t<Classes>\r\n" +
4242
"\t\t\t\t<Class>\r\n" +
@@ -45,11 +45,11 @@ public void SetUpFixture()
4545
"\t\t\t\t\t\t<Method visited=\"true\" cyclomaticComplexity=\"1\" sequenceCoverage=\"100\" branchCoverage=\"100\" isConstructor=\"false\" isStatic=\"false\" isGetter=\"false\" isSetter=\"false\">\r\n" +
4646
"\t\t\t\t\t\t\t<MetadataToken>100663297</MetadataToken>\r\n" +
4747
"\t\t\t\t\t\t\t<Name>System.Void Foo.Tests.FooTestFixture::SimpleTest()</Name>\r\n" +
48-
"\t\t\t\t\t\t\t<FileRef uid=\"1\" />\r\n" +
48+
"\t\t\t\t\t\t\t<FileRef uid=\"2\" />\r\n" +
4949
"\t\t\t\t\t\t\t<SequencePoints>\r\n" +
50-
"\t\t\t\t\t\t\t\t<SequencePoint vc=\"1\" sl=\"20\" sc=\"3\" el=\"20\" ec=\"4\" />\r\n" +
51-
"\t\t\t\t\t\t\t\t<SequencePoint vc=\"1\" sl=\"21\" sc=\"13\" el=\"21\" ec=\"32\" />\r\n" +
52-
"\t\t\t\t\t\t\t\t<SequencePoint vc=\"0\" sl=\"24\" sc=\"3\" el=\"24\" ec=\"4\" />\r\n" +
50+
"\t\t\t\t\t\t\t\t<SequencePoint vc=\"1\" sl=\"20\" sc=\"3\" el=\"20\" ec=\"4\" fileid=\"2\" />\r\n" +
51+
"\t\t\t\t\t\t\t\t<SequencePoint vc=\"1\" sl=\"21\" sc=\"13\" el=\"21\" ec=\"32\" fileid=\"2\" />\r\n" +
52+
"\t\t\t\t\t\t\t\t<SequencePoint vc=\"0\" sl=\"24\" sc=\"3\" el=\"24\" ec=\"4\" fileid=\"2\" />\r\n" +
5353
"\t\t\t\t\t\t\t</SequencePoints>\r\n" +
5454
"\t\t\t\t\t\t</Method>\r\n" +
5555
"\t\t\t\t\t</Methods>\r\n" +
@@ -123,10 +123,14 @@ public void SequencePointsCount_MethodHasThreeSequencePoints_ReturnsThree()
123123
Assert.AreEqual(3, count);
124124
}
125125

126-
[Test, Ignore("SequencePoint.Length is not 1 anymore")]
126+
[Test]
127127
public void SequencePoint_FirstSequencePoint_HasExpectedPropertyValues()
128128
{
129+
Assert.Inconclusive("SequencePoint.Length is computed from text-source not present in this test");
130+
129131
CodeCoverageSequencePoint point = base.CreateSequencePoint();
132+
// ??? if in this.SetUpFixture fileId is set to "1" then filename from another test fixture is returned ???
133+
// ??? "c:\test\MyTests\Class1.cs"
130134
point.Document = @"c:\Projects\Foo\FooTestFixture.cs";
131135
point.VisitCount = 1;
132136
point.Column = 3;
@@ -166,16 +170,18 @@ public void NotVisitedSequencePointsCount_FirstMethod_ReturnsOne()
166170
Assert.AreEqual(1, count);
167171
}
168172

169-
[Test, Ignore("SequencePoint.Length is not 1 anymore")]
173+
[Test]
170174
public void GetVisitedCodeLength_FirstMethod_ReturnsSummedLengthOfVisitedSequencePoints()
171175
{
176+
Assert.Inconclusive("SequencePoint.Length is computed from text-source not present in this test");
172177
int length = FirstModuleFirstMethod.GetVisitedCodeLength();
173178
Assert.AreEqual(2, length);
174179
}
175180

176-
[Test, Ignore("SequencePoint.Length is not 1 anymore")]
181+
[Test]
177182
public void GetUnvisitedCodeLength_FirstMethod_ReturnsSummedLengthOfUnvisitedSequencePoints()
178183
{
184+
Assert.Inconclusive("SequencePoint.Length is computed from text-source not present in this test");
179185
int length = FirstModuleFirstMethod.GetUnvisitedCodeLength();
180186
Assert.AreEqual(1, length);
181187
}

src/AddIns/Analysis/CodeCoverage/Test/Coverage/ModuleVisitedSequencePointsTestFixture.cs

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -110,33 +110,37 @@ CodeCoverageModule BarModule {
110110
get { return SecondModule; }
111111
}
112112

113-
[Test, Ignore("SequencePoint.Length is not 1 anymore")]
113+
[Test]
114114
public void ModuleGetVisitedCodeLength_FooModule_ReturnsTotalLengthOfAllVisitedMethodSequencePoints()
115115
{
116+
Assert.Inconclusive("SequencePoint.Length is computed from text-source not present in this test");
116117
int length = FooModule.GetVisitedCodeLength();
117118
int expectedLength = 4;
118119
Assert.AreEqual(expectedLength, length);
119120
}
120121

121-
[Test, Ignore("SequencePoint.Length is not 1 anymore")]
122+
[Test]
122123
public void ModuleGetUnvisitedCodeLength_FooModule_ReturnsTotalLengthOfAllNonVisitedMethodSequencePoints()
123124
{
125+
Assert.Inconclusive("SequencePoint.Length is computed from text-source not present in this test");
124126
int length = FooModule.GetUnvisitedCodeLength();
125127
int expectedLength = 2;
126128
Assert.AreEqual(expectedLength, length);
127129
}
128130

129-
[Test, Ignore("SequencePoint.Length is not 1 anymore")]
131+
[Test]
130132
public void ModuleGetVisitedCodeLength_BarModule_ReturnsTotalLengthOfAllVisitedMethodSequencePoints()
131133
{
134+
Assert.Inconclusive("SequencePoint.Length is computed from text-source not present in this test");
132135
int length = BarModule.GetVisitedCodeLength();
133136
int expectedLength = 2;
134137
Assert.AreEqual(expectedLength, length);
135138
}
136139

137-
[Test, Ignore("SequencePoint.Length is not 1 anymore")]
140+
[Test]
138141
public void ModuleGetUnvisitedCodeLength_BarModule_ReturnsTotalLengthOfAllNonVisitedMethodSequencePoints()
139142
{
143+
Assert.Inconclusive("SequencePoint.Length is computed from text-source not present in this test");
140144
int length = BarModule.GetUnvisitedCodeLength();
141145
int expectedLength = 1;
142146
Assert.AreEqual(expectedLength, length);

src/AddIns/Analysis/CodeCoverage/Test/Gui/PropertiesInCodeCoverageTreeView.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -112,9 +112,9 @@ public void PropertyTreeNode_CountPropertyTreeNode_Exists()
112112
}
113113

114114
[Test]
115-
[Ignore("CodeCoverageImageListIndex.Property is 8, ImageIndex is 9")]
116115
public void PropertyTreeNodeImageIndex_CountPropertyTreeNode_ImageIndexIsProperty()
117116
{
117+
Assert.Inconclusive("??? CodeCoverageImageListIndex.Property is 8, ImageIndex is 9 ???");
118118
Assert.AreEqual(CodeCoverageImageListIndex.Property, (CodeCoverageImageListIndex)countPropertyTreeNode.ImageIndex);
119119
}
120120

@@ -125,24 +125,24 @@ public void PropertyTreeNodeChildNodesCount_CountPropertyTreeNode_HasTwoChildNod
125125
}
126126

127127
[Test]
128-
[Ignore("Visited length not implemented with OpenCover")]
129128
public void PropertyTreeNodeVisitedCodeLength_CountPropertyTreeNode_ReturnsThree()
130129
{
130+
Assert.Inconclusive("SequencePoint.Length is computed from text-source not present in this test");
131131
Assert.AreEqual(3, countPropertyTreeNode.VisitedCodeLength);
132132
}
133133

134134
[Test]
135-
[Ignore("Visited length not implemented with OpenCover")]
136135
public void VisitedCodeLength_PropertyTreeNode_ReturnsThree()
137136
{
137+
Assert.Inconclusive("SequencePoint.Length is computed from text-source not present in this test");
138138
int count = countPropertyTreeNode.VisitedCodeLength;
139139
Assert.AreEqual(3, count);
140140
}
141141

142142
[Test]
143-
[Ignore("Unvisited length not implemented with OpenCover")]
144143
public void UnvisitedCodeLength_PropertyTreeNode_ReturnsThree()
145144
{
145+
Assert.Inconclusive("SequencePoint.Length is computed from text-source not present in this test");
146146
int count = countPropertyTreeNode.UnvisitedCodeLength;
147147
Assert.AreEqual(1, count);
148148
}

0 commit comments

Comments
 (0)