Skip to content

Commit 1c3c7a5

Browse files
committed
Add ExcludeFromCodeCoverage to test classes
Added [ExcludeFromCodeCoverage] attribute to various test and sample classes across the project to exclude them from code coverage analysis. This helps ensure that code coverage metrics focus on production code rather than test scaffolding.
1 parent 61eab63 commit 1c3c7a5

File tree

18 files changed

+36
-0
lines changed

18 files changed

+36
-0
lines changed

src/ReactiveUI.SourceGenerators.Execute.Maui/IViewForTest.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
// The ReactiveUI and contributors licenses this file to you under the MIT license.
44
// See the LICENSE file in the project root for full license information.
55

6+
using System.Diagnostics.CodeAnalysis;
67
using ReactiveUI.SourceGenerators;
78

89
namespace SGReactiveUI.SourceGenerators.Test.Maui
@@ -11,6 +12,7 @@ namespace SGReactiveUI.SourceGenerators.Test.Maui
1112
/// IViewForTest.
1213
/// </summary>
1314
/// <seealso cref="NavigationPage" />
15+
[ExcludeFromCodeCoverage]
1416
[IViewFor<TestViewModel>]
1517
public partial class IViewForTest : Shell;
1618
}

src/ReactiveUI.SourceGenerators.Execute.Maui/TestViewModel.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
// The ReactiveUI and contributors licenses this file to you under the MIT license.
44
// See the LICENSE file in the project root for full license information.
55

6+
using System.Diagnostics.CodeAnalysis;
67
using System.Reactive;
78
using System.Reactive.Linq;
89
using System.Runtime.Serialization;
@@ -15,6 +16,7 @@ namespace SGReactiveUI.SourceGenerators.Test;
1516
/// <summary>
1617
/// TestClass.
1718
/// </summary>
19+
[ExcludeFromCodeCoverage]
1820
[DataContract]
1921
public partial class TestViewModel : ReactiveObject
2022
{

src/ReactiveUI.SourceGenerators.Execute.Nested1/Class1.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
// The ReactiveUI and contributors licenses this file to you under the MIT license.
44
// See the LICENSE file in the project root for full license information.
55

6+
using System.Diagnostics.CodeAnalysis;
67
using ReactiveUI;
78
using ReactiveUI.SourceGenerators;
89

@@ -11,6 +12,7 @@ namespace SGReactiveUI.SourceGenerators.Execute.Nested1;
1112
/// <summary>
1213
/// Class1.
1314
/// </summary>
15+
[ExcludeFromCodeCoverage]
1416
public partial class Class1 : ReactiveObject
1517
{
1618
[Reactive]

src/ReactiveUI.SourceGenerators.Execute.Nested2/Class1.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
// The ReactiveUI and contributors licenses this file to you under the MIT license.
44
// See the LICENSE file in the project root for full license information.
55

6+
using System.Diagnostics.CodeAnalysis;
67
using ReactiveUI;
78
using ReactiveUI.SourceGenerators;
89

@@ -11,6 +12,7 @@ namespace SGReactiveUI.SourceGenerators.Execute.Nested2;
1112
/// <summary>
1213
/// Class1.
1314
/// </summary>
15+
[ExcludeFromCodeCoverage]
1416
public partial class Class1 : ReactiveObject
1517
{
1618
[Reactive]

src/ReactiveUI.SourceGenerators.Execute.Nested3/Class1.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
// The ReactiveUI and contributors licenses this file to you under the MIT license.
44
// See the LICENSE file in the project root for full license information.
55

6+
using System.Diagnostics.CodeAnalysis;
67
using ReactiveUI;
78
using ReactiveUI.SourceGenerators;
89

@@ -11,6 +12,7 @@ namespace SGReactiveUI.SourceGenerators.Execute.Nested3;
1112
/// <summary>
1213
/// Class1.
1314
/// </summary>
15+
[ExcludeFromCodeCoverage]
1416
public partial class Class1 : ReactiveObject
1517
{
1618
[Reactive]

src/ReactiveUI.SourceGenerators.Execute/InternalTestViewModel.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,13 @@
44
// See the LICENSE file in the project root for full license information.
55

66
using System.Collections.ObjectModel;
7+
using System.Diagnostics.CodeAnalysis;
78
using ReactiveUI;
89
using ReactiveUI.SourceGenerators;
910

1011
namespace SGReactiveUI.SourceGenerators.Test;
1112

13+
[ExcludeFromCodeCoverage]
1214
internal partial class InternalTestViewModel : ReactiveObject
1315
{
1416
[ReactiveCollection]

src/ReactiveUI.SourceGenerators.Execute/Person.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
// The ReactiveUI and contributors licenses this file to you under the MIT license.
44
// See the LICENSE file in the project root for full license information.
55

6+
using System.Diagnostics.CodeAnalysis;
67
using ReactiveUI;
78
using ReactiveUI.SourceGenerators;
89

@@ -12,6 +13,7 @@ namespace SGReactiveUI.SourceGenerators.Test;
1213
/// Person.
1314
/// </summary>
1415
/// <seealso cref="ReactiveUI.ReactiveObject" />
16+
[ExcludeFromCodeCoverage]
1517
public partial class Person : ReactiveObject
1618
{
1719
/// <summary>

src/ReactiveUI.SourceGenerators.Execute/Program.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
// The ReactiveUI and contributors licenses this file to you under the MIT license.
44
// See the LICENSE file in the project root for full license information.
55

6+
using System.Diagnostics.CodeAnalysis;
67
using ReactiveUI.SourceGenerators;
78
using Splat;
89

@@ -11,6 +12,7 @@ namespace SGReactiveUI.SourceGenerators.Test;
1112
/// <summary>
1213
/// EntryPoint.
1314
/// </summary>
15+
[ExcludeFromCodeCoverage]
1416
public static class Program
1517
{
1618
/// <summary>

src/ReactiveUI.SourceGenerators.Execute/TestAttribute.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,15 @@
33
// The ReactiveUI and contributors licenses this file to you under the MIT license.
44
// See the LICENSE file in the project root for full license information.
55

6+
using System.Diagnostics.CodeAnalysis;
7+
68
namespace SGReactiveUI.SourceGenerators.Test;
79

810
/// <summary>
911
/// TestAttribute.
1012
/// </summary>
1113
/// <seealso cref="System.Attribute" />
14+
[ExcludeFromCodeCoverage]
1215
[AttributeUsage(AttributeTargets.Property, AllowMultiple = false, Inherited = false)]
1316
public sealed class TestAttribute : Attribute
1417
{

src/ReactiveUI.SourceGenerators.Execute/TestClassOAPH_VM.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
// The ReactiveUI and contributors licenses this file to you under the MIT license.
44
// See the LICENSE file in the project root for full license information.
55

6+
using System.Diagnostics.CodeAnalysis;
67
using ReactiveUI;
78
using ReactiveUI.SourceGenerators;
89

@@ -11,6 +12,7 @@ namespace SGReactiveUI.SourceGenerators.Test;
1112
/// <summary>
1213
/// TestClassOAPH VM.
1314
/// </summary>
15+
[ExcludeFromCodeCoverage]
1416
public partial class TestClassOAPH_VM : ReactiveObject
1517
{
1618
[ObservableAsProperty]

0 commit comments

Comments
 (0)