Skip to content

Commit c33ee56

Browse files
authored
chore: Refactor and expand source generator test coverage (#378)
This commit restructures and renames many test verification files for the ReactiveUI source generators, removing redundant or obsolete test outputs and adding new test cases for various scenarios including nested classes, generics, records, arrays, and more. The changes improve organization and coverage for BindableDerivedList, IViewFor, ObservableAsProperty, Reactive, and ReactiveCommand source generators, ensuring more comprehensive and maintainable test verification.
1 parent dff50fe commit c33ee56

364 files changed

Lines changed: 16793 additions & 915 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

src/Directory.Packages.props

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<CodeAnalysisVersion>4.8.0</CodeAnalysisVersion>
66
</PropertyGroup>
77
<ItemGroup>
8-
<PackageVersion Include="Microsoft.SourceLink.GitHub" Version="8.0.0" />
8+
<PackageVersion Include="Microsoft.SourceLink.GitHub" Version="10.0.102" />
99
<PackageVersion Include="Nerdbank.GitVersioning" Version="3.9.50" />
1010
<PackageVersion Include="NuGet.Common" Version="6.14.0" />
1111
<PackageVersion Include="NuGet.Protocol" Version="6.14.0" />
@@ -44,4 +44,4 @@
4444
<PackageVersion Include="Basic.Reference.Assemblies.Net80" Version="1.8.4" />
4545
<PackageVersion Include="Basic.Reference.Assemblies.Net80Windows" Version="1.8.4" />
4646
</ItemGroup>
47-
</Project>
47+
</Project>

src/ReactiveUI.SourceGenerator.Tests/AssemblyInfo.Parallel.cs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,5 @@
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 NUnit.Framework;
7-
86
[assembly: Parallelizable(ParallelScope.Fixtures)]
97
[assembly: LevelOfParallelism(4)]

src/ReactiveUI.SourceGenerator.Tests/DERIVEDLIST/BindableDerivedListGeneratorTests.FromReactiveProperties#ReactiveUI.SourceGenerators.BindableDerivedListAttribute.g.verified.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,4 +16,4 @@ namespace ReactiveUI.SourceGenerators;
1616
[global::System.AttributeUsage(global::System.AttributeTargets.Field, AllowMultiple = false, Inherited = false)]
1717
internal sealed class BindableDerivedListAttribute : global::System.Attribute;
1818
#nullable restore
19-
#pragma warning restore
19+
#pragma warning restore

src/ReactiveUI.SourceGenerator.Tests/DERIVEDLIST/ReactiveCollectionGeneratorTests.FromReactiveCollectionField#ReactiveUI.SourceGenerators.BindableDerivedListAttribute.g.verified.cs renamed to src/ReactiveUI.SourceGenerator.Tests/DERIVEDLIST/DerivedListExtTests.ComplexGeneric#ReactiveUI.SourceGenerators.BindableDerivedListAttribute.g.verified.cs

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,6 @@
44
// The .NET Foundation licenses this file to you under the MIT license.
55
// See the LICENSE file in the project root for full license information.
66

7-
using System;
8-
97
// <auto-generated/>
108
#pragma warning disable
119
#nullable enable
@@ -15,7 +13,7 @@ namespace ReactiveUI.SourceGenerators;
1513
/// ReactiveAttribute.
1614
/// </summary>
1715
/// <seealso cref="Attribute" />
18-
[AttributeUsage(AttributeTargets.Field, AllowMultiple = false, Inherited = false)]
19-
internal sealed class BindableDerivedListAttribute : Attribute;
16+
[global::System.AttributeUsage(global::System.AttributeTargets.Field, AllowMultiple = false, Inherited = false)]
17+
internal sealed class BindableDerivedListAttribute : global::System.Attribute;
2018
#nullable restore
21-
#pragma warning restore
19+
#pragma warning restore
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
//HintName: ReactiveUI.SourceGenerators.BindableDerivedListAttribute.g.cs
2+
// Copyright (c) 2026 .NET Foundation and Contributors. All rights reserved.
3+
// Licensed to the .NET Foundation under one or more agreements.
4+
// The .NET Foundation licenses this file to you under the MIT license.
5+
// See the LICENSE file in the project root for full license information.
6+
7+
// <auto-generated/>
8+
#pragma warning disable
9+
#nullable enable
10+
namespace ReactiveUI.SourceGenerators;
11+
12+
/// <summary>
13+
/// ReactiveAttribute.
14+
/// </summary>
15+
/// <seealso cref="Attribute" />
16+
[global::System.AttributeUsage(global::System.AttributeTargets.Field, AllowMultiple = false, Inherited = false)]
17+
internal sealed class BindableDerivedListAttribute : global::System.Attribute;
18+
#nullable restore
19+
#pragma warning restore
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
//HintName: ReactiveUI.SourceGenerators.BindableDerivedListAttribute.g.cs
2+
// Copyright (c) 2026 .NET Foundation and Contributors. All rights reserved.
3+
// Licensed to the .NET Foundation under one or more agreements.
4+
// The .NET Foundation licenses this file to you under the MIT license.
5+
// See the LICENSE file in the project root for full license information.
6+
7+
// <auto-generated/>
8+
#pragma warning disable
9+
#nullable enable
10+
namespace ReactiveUI.SourceGenerators;
11+
12+
/// <summary>
13+
/// ReactiveAttribute.
14+
/// </summary>
15+
/// <seealso cref="Attribute" />
16+
[global::System.AttributeUsage(global::System.AttributeTargets.Field, AllowMultiple = false, Inherited = false)]
17+
internal sealed class BindableDerivedListAttribute : global::System.Attribute;
18+
#nullable restore
19+
#pragma warning restore
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
//HintName: ReactiveUI.SourceGenerators.BindableDerivedListAttribute.g.cs
2+
// Copyright (c) 2026 .NET Foundation and Contributors. All rights reserved.
3+
// Licensed to the .NET Foundation under one or more agreements.
4+
// The .NET Foundation licenses this file to you under the MIT license.
5+
// See the LICENSE file in the project root for full license information.
6+
7+
// <auto-generated/>
8+
#pragma warning disable
9+
#nullable enable
10+
namespace ReactiveUI.SourceGenerators;
11+
12+
/// <summary>
13+
/// ReactiveAttribute.
14+
/// </summary>
15+
/// <seealso cref="Attribute" />
16+
[global::System.AttributeUsage(global::System.AttributeTargets.Field, AllowMultiple = false, Inherited = false)]
17+
internal sealed class BindableDerivedListAttribute : global::System.Attribute;
18+
#nullable restore
19+
#pragma warning restore
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
//HintName: ReactiveUI.SourceGenerators.BindableDerivedListAttribute.g.cs
2+
// Copyright (c) 2026 .NET Foundation and Contributors. All rights reserved.
3+
// Licensed to the .NET Foundation under one or more agreements.
4+
// The .NET Foundation licenses this file to you under the MIT license.
5+
// See the LICENSE file in the project root for full license information.
6+
7+
// <auto-generated/>
8+
#pragma warning disable
9+
#nullable enable
10+
namespace ReactiveUI.SourceGenerators;
11+
12+
/// <summary>
13+
/// ReactiveAttribute.
14+
/// </summary>
15+
/// <seealso cref="Attribute" />
16+
[global::System.AttributeUsage(global::System.AttributeTargets.Field, AllowMultiple = false, Inherited = false)]
17+
internal sealed class BindableDerivedListAttribute : global::System.Attribute;
18+
#nullable restore
19+
#pragma warning restore
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
//HintName: ReactiveUI.SourceGenerators.BindableDerivedListAttribute.g.cs
2+
// Copyright (c) 2026 .NET Foundation and Contributors. All rights reserved.
3+
// Licensed to the .NET Foundation under one or more agreements.
4+
// The .NET Foundation licenses this file to you under the MIT license.
5+
// See the LICENSE file in the project root for full license information.
6+
7+
// <auto-generated/>
8+
#pragma warning disable
9+
#nullable enable
10+
namespace ReactiveUI.SourceGenerators;
11+
12+
/// <summary>
13+
/// ReactiveAttribute.
14+
/// </summary>
15+
/// <seealso cref="Attribute" />
16+
[global::System.AttributeUsage(global::System.AttributeTargets.Field, AllowMultiple = false, Inherited = false)]
17+
internal sealed class BindableDerivedListAttribute : global::System.Attribute;
18+
#nullable restore
19+
#pragma warning restore
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
//HintName: ReactiveUI.SourceGenerators.BindableDerivedListAttribute.g.cs
2+
// Copyright (c) 2026 .NET Foundation and Contributors. All rights reserved.
3+
// Licensed to the .NET Foundation under one or more agreements.
4+
// The .NET Foundation licenses this file to you under the MIT license.
5+
// See the LICENSE file in the project root for full license information.
6+
7+
// <auto-generated/>
8+
#pragma warning disable
9+
#nullable enable
10+
namespace ReactiveUI.SourceGenerators;
11+
12+
/// <summary>
13+
/// ReactiveAttribute.
14+
/// </summary>
15+
/// <seealso cref="Attribute" />
16+
[global::System.AttributeUsage(global::System.AttributeTargets.Field, AllowMultiple = false, Inherited = false)]
17+
internal sealed class BindableDerivedListAttribute : global::System.Attribute;
18+
#nullable restore
19+
#pragma warning restore

0 commit comments

Comments
 (0)