Skip to content

Commit eac4cfc

Browse files
committed
some code cleanup
1 parent bdb6108 commit eac4cfc

File tree

7 files changed

+15
-14
lines changed

7 files changed

+15
-14
lines changed

src/coverlet.core/Coverage.cs

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
using System.IO;
44
using System.Linq;
55

6+
using Coverlet.Core.Enums;
67
using Coverlet.Core.Helpers;
78
using Coverlet.Core.Instrumentation;
89
using Coverlet.Core.Symbols;
@@ -48,7 +49,7 @@ public Coverage(string module, string[] includeFilters, string[] includeDirector
4849
public void PrepareModules()
4950
{
5051
string[] modules = InstrumentationHelper.GetCoverableModules(_module, _includeDirectories);
51-
string[] excludes = InstrumentationHelper.GetExcludedFiles(_excludedSourceFiles);
52+
string[] excludes = InstrumentationHelper.GetExcludedFiles(_excludedSourceFiles);
5253
_excludeFilters = _excludeFilters?.Where(f => InstrumentationHelper.IsValidFilterExpression(f)).ToArray();
5354
_includeFilters = _includeFilters?.Where(f => InstrumentationHelper.IsValidFilterExpression(f)).ToArray();
5455

@@ -131,14 +132,14 @@ public CoverageResult GetCoverageResult()
131132
if (methods.TryGetValue(branch.Method, out Method method))
132133
{
133134
method.Branches.Add(new BranchInfo
134-
{ Line = branch.Number, Hits = branch.Hits, Offset = branch.Offset, EndOffset = branch.EndOffset, Path = branch.Path, Ordinal = branch.Ordinal }
135+
{ Line = branch.Number, Hits = branch.Hits, Offset = branch.Offset, EndOffset = branch.EndOffset, Path = branch.Path, Ordinal = branch.Ordinal }
135136
);
136137
}
137138
else
138139
{
139140
documents[doc.Path][branch.Class].Add(branch.Method, new Method());
140141
documents[doc.Path][branch.Class][branch.Method].Branches.Add(new BranchInfo
141-
{ Line = branch.Number, Hits = branch.Hits, Offset = branch.Offset, EndOffset = branch.EndOffset, Path = branch.Path, Ordinal = branch.Ordinal }
142+
{ Line = branch.Number, Hits = branch.Hits, Offset = branch.Offset, EndOffset = branch.EndOffset, Path = branch.Path, Ordinal = branch.Ordinal }
142143
);
143144
}
144145
}
@@ -147,7 +148,7 @@ public CoverageResult GetCoverageResult()
147148
documents[doc.Path].Add(branch.Class, new Methods());
148149
documents[doc.Path][branch.Class].Add(branch.Method, new Method());
149150
documents[doc.Path][branch.Class][branch.Method].Branches.Add(new BranchInfo
150-
{ Line = branch.Number, Hits = branch.Hits, Offset = branch.Offset, EndOffset = branch.EndOffset, Path = branch.Path, Ordinal = branch.Ordinal }
151+
{ Line = branch.Number, Hits = branch.Hits, Offset = branch.Offset, EndOffset = branch.EndOffset, Path = branch.Path, Ordinal = branch.Ordinal }
151152
);
152153
}
153154
}
@@ -157,7 +158,7 @@ public CoverageResult GetCoverageResult()
157158
documents[doc.Path].Add(branch.Class, new Methods());
158159
documents[doc.Path][branch.Class].Add(branch.Method, new Method());
159160
documents[doc.Path][branch.Class][branch.Method].Branches.Add(new BranchInfo
160-
{ Line = branch.Number, Hits = branch.Hits, Offset = branch.Offset, EndOffset = branch.EndOffset, Path = branch.Path, Ordinal = branch.Ordinal }
161+
{ Line = branch.Number, Hits = branch.Hits, Offset = branch.Offset, EndOffset = branch.EndOffset, Path = branch.Path, Ordinal = branch.Ordinal }
161162
);
162163
}
163164
}
@@ -292,7 +293,7 @@ private string GetSourceLinkUrl(Dictionary<string, string> sourceLinkDocuments,
292293
}
293294

294295
relativePathOfBestMatch = relativePathOfBestMatch == "." ? string.Empty : relativePathOfBestMatch;
295-
296+
296297
string replacement = Path.Combine(relativePathOfBestMatch, Path.GetFileName(document));
297298
replacement = replacement.Replace('\\', '/');
298299

src/coverlet.core/Reporters/ReporterFactory.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
using System;
22
using System.Linq;
33
using System.Collections.Generic;
4-
using coverlet.core.Reporters;
4+
using Coverlet.Core.Reporters;
55

66
namespace Coverlet.Core.Reporters
77
{

src/coverlet.core/Reporters/TeamCityReporter.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
using Coverlet.Core.Reporters;
44
using System.Text;
55

6-
namespace coverlet.core.Reporters
6+
namespace Coverlet.Core.Reporters
77
{
88
public class TeamCityReporter : IReporter
99
{

test/coverlet.core.performancetest/PerformanceTest.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,13 @@
33
using System.Collections.Generic;
44
using Xunit;
55

6-
namespace coverlet.core.performancetest
6+
namespace Coverlet.Core.PerformanceTest
77
{
88
/// <summary>
99
/// Test the performance of coverlet by running a unit test that calls a reasonably big and complex test class.
1010
/// Enable the test, compile, then run the test in the command line:
1111
/// <code>
12-
/// dotnet test /p:CollectCoverage=true test/coverlet.core.performancetest/
12+
/// dotnet test /p:CollectCoverage=true test/Coverlet.Core.PerformanceTest/
1313
/// </code>
1414
/// </summary>
1515
public class PerformanceTest

test/coverlet.core.tests/Instrumentation/ModuleTrackerTemplateTests.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
using System.Threading.Tasks;
66
using Xunit;
77

8-
namespace coverlet.core.tests.Instrumentation
8+
namespace Coverlet.Core.Tests.Instrumentation
99
{
1010
public class ModuleTrackerTemplateTestsFixture : IDisposable
1111
{

test/coverlet.core.tests/Reporters/ReporterFactoryTests.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
using coverlet.core.Reporters;
1+
using Coverlet.Core.Reporters;
22
using Xunit;
33

44
namespace Coverlet.Core.Reporters.Tests

test/coverlet.core.tests/Reporters/TeamCityReporter.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
using coverlet.core.Reporters;
2-
using System;
1+
using System;
2+
using Coverlet.Core.Reporters;
33
using Xunit;
44

55
namespace Coverlet.Core.Reporters.Tests

0 commit comments

Comments
 (0)