Skip to content

Commit 5abfa34

Browse files
author
Cédric Belin
committed
Mark some classes as sealed
1 parent 4140aaf commit 5abfa34

File tree

5 files changed

+8
-8
lines changed

5 files changed

+8
-8
lines changed

.github/workflows/ci.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,6 @@ jobs:
1010
- name: Set up .NET
1111
uses: actions/setup-dotnet@v4
1212
with:
13-
dotnet-version: 8
13+
dotnet-version: 9
1414
- name: Run tests
1515
run: dotnet test

src/branch.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ namespace Belin.Lcov;
66
/// <param name="found">The number of branches found.</param>
77
/// <param name="hit">The number of branches hit.</param>
88
/// <param name="data">The coverage data.</param>
9-
public class BranchCoverage(int found = 0, int hit = 0, IEnumerable<BranchData>? data = null) {
9+
public sealed class BranchCoverage(int found = 0, int hit = 0, IEnumerable<BranchData>? data = null) {
1010

1111
/// <summary>
1212
/// The coverage data.
@@ -43,7 +43,7 @@ .. Data.Select(item => item.ToString()),
4343
/// <param name="BlockNumber">The block number.</param>
4444
/// <param name="BranchNumber">The branch number.</param>
4545
/// <param name="Taken">A number indicating how often this branch was taken.</param>
46-
public record BranchData(int LineNumber = 0, int BlockNumber = 0, int BranchNumber = 0, int Taken = 0) {
46+
public sealed record BranchData(int LineNumber = 0, int BlockNumber = 0, int BranchNumber = 0, int Taken = 0) {
4747

4848
/// <summary>
4949
/// Returns a string representation of this object.

src/function.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ namespace Belin.Lcov;
66
/// <param name="found">The number of functions found.</param>
77
/// <param name="hit">The number of functions hit.</param>
88
/// <param name="data">The coverage data.</param>
9-
public class FunctionCoverage(int found = 0, int hit = 0, IEnumerable<FunctionData>? data = null) {
9+
public sealed class FunctionCoverage(int found = 0, int hit = 0, IEnumerable<FunctionData>? data = null) {
1010

1111
/// <summary>
1212
/// The coverage data.
@@ -43,7 +43,7 @@ .. Data.Select(item => item.ToString(asDefinition: false)),
4343
/// <param name="FunctionName">The function name.</param>
4444
/// <param name="LineNumber">The line number of the function start.</param>
4545
/// <param name="ExecutionCount">The execution count.</param>
46-
public record FunctionData(string FunctionName = "", int LineNumber = 0, int ExecutionCount = 0) {
46+
public sealed record FunctionData(string FunctionName = "", int LineNumber = 0, int ExecutionCount = 0) {
4747

4848
/// <summary>
4949
/// Returns a string representation of this object.

src/line.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ namespace Belin.Lcov;
66
/// <param name="found">The number of lines found.</param>
77
/// <param name="hit">The number of lines hit.</param>
88
/// <param name="data">The coverage data.</param>
9-
public class LineCoverage(int found = 0, int hit = 0, IEnumerable<LineData>? data = null) {
9+
public sealed class LineCoverage(int found = 0, int hit = 0, IEnumerable<LineData>? data = null) {
1010

1111
/// <summary>
1212
/// The coverage data.
@@ -42,7 +42,7 @@ .. Data.Select(item => item.ToString()),
4242
/// <param name="LineNumber">The line number.</param>
4343
/// <param name="ExecutionCount">The execution count.</param>
4444
/// <param name="Checksum">The data checksum.</param>
45-
public record LineData(int LineNumber = 0, int ExecutionCount = 0, string Checksum = "") {
45+
public sealed record LineData(int LineNumber = 0, int ExecutionCount = 0, string Checksum = "") {
4646

4747
/// <summary>
4848
/// Returns a string representation of this object.

src/source_file.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ namespace Belin.Lcov;
77
/// <param name="functions">The function coverage.</param>
88
/// <param name="branches">The branch coverage.</param>
99
/// <param name="lines">The line coverage.</param>
10-
public class SourceFile(string path, FunctionCoverage? functions = null, BranchCoverage? branches = null, LineCoverage? lines = null) {
10+
public sealed class SourceFile(string path, FunctionCoverage? functions = null, BranchCoverage? branches = null, LineCoverage? lines = null) {
1111

1212
/// <summary>
1313
/// The branch coverage.

0 commit comments

Comments
 (0)