Skip to content

Commit

Permalink
Update tests to remove generator version before verifying (#105)
Browse files Browse the repository at this point in the history
* Update tests

* Update tests to remove Generator version
  • Loading branch information
ChrisPulman authored Nov 5, 2024
1 parent c4fdf4f commit c8dc8ca
Show file tree
Hide file tree
Showing 30 changed files with 27 additions and 46 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ namespace ReactiveUI.SourceGenerators;
/// ObservableAsPropertyAttribute.
/// </summary>
/// <seealso cref="Attribute" />
[global::System.CodeDom.Compiler.GeneratedCode("ReactiveUI.SourceGenerators.ObservableAsPropertyGenerator", "1.1.0.0")]
[AttributeUsage(AttributeTargets.Field | AttributeTargets.Property | AttributeTargets.Method, AllowMultiple = false, Inherited = false)]
internal sealed class ObservableAsPropertyAttribute : Attribute
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ namespace TestNs
/// </summary>
public partial class TestVM
{
[global::System.CodeDom.Compiler.GeneratedCode("ReactiveUI.SourceGenerators.ObservableAsPropertyGenerator", "1.1.0.0")]
/// <inheritdoc cref="Test2Property"/>
private int _test2Property;

Expand All @@ -23,7 +22,6 @@ public partial class TestVM
[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage]
public int Test2Property { get => _test2Property = _test2PropertyHelper?.Value ?? _test2Property; }

[global::System.CodeDom.Compiler.GeneratedCode("ReactiveUI.SourceGenerators.ObservableAsPropertyGenerator", "1.1.0.0")]
[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage]
protected void InitializeOAPH()
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ namespace ReactiveUI.SourceGenerators;
/// ObservableAsPropertyAttribute.
/// </summary>
/// <seealso cref="Attribute" />
[global::System.CodeDom.Compiler.GeneratedCode("ReactiveUI.SourceGenerators.ObservableAsPropertyGenerator", "1.1.0.0")]
[AttributeUsage(AttributeTargets.Field | AttributeTargets.Property | AttributeTargets.Method, AllowMultiple = false, Inherited = false)]
internal sealed class ObservableAsPropertyAttribute : Attribute
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ namespace TestNs
/// </summary>
public partial class TestVM
{
[global::System.CodeDom.Compiler.GeneratedCode("ReactiveUI.SourceGenerators.ObservableAsPropertyGenerator", "1.1.0.0")]
/// <inheritdoc cref="Test3Property"/>
private int _test3Property;

Expand All @@ -23,7 +22,6 @@ public partial class TestVM
[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage]
public int Test3Property { get => _test3Property = _test3PropertyHelper?.Value ?? _test3Property; }

[global::System.CodeDom.Compiler.GeneratedCode("ReactiveUI.SourceGenerators.ObservableAsPropertyGenerator", "1.1.0.0")]
[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage]
protected void InitializeOAPH()
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ namespace ReactiveUI.SourceGenerators;
/// ObservableAsPropertyAttribute.
/// </summary>
/// <seealso cref="Attribute" />
[global::System.CodeDom.Compiler.GeneratedCode("ReactiveUI.SourceGenerators.ObservableAsPropertyGenerator", "1.1.0.0")]
[AttributeUsage(AttributeTargets.Field | AttributeTargets.Property | AttributeTargets.Method, AllowMultiple = false, Inherited = false)]
internal sealed class ObservableAsPropertyAttribute : Attribute
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ namespace TestNs
/// </summary>
public partial class TestVM
{
[global::System.CodeDom.Compiler.GeneratedCode("ReactiveUI.SourceGenerators.ObservableAsPropertyGenerator", "1.1.0.0")]
/// <inheritdoc cref="Test1Property"/>
private int _test1Property;

Expand All @@ -23,7 +22,6 @@ public partial class TestVM
[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage]
public int Test1Property { get => _test1Property = _test1PropertyHelper?.Value ?? _test1Property; }

[global::System.CodeDom.Compiler.GeneratedCode("ReactiveUI.SourceGenerators.ObservableAsPropertyGenerator", "1.1.0.0")]
[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage]
protected void InitializeOAPH()
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ namespace ReactiveUI.SourceGenerators;
/// ObservableAsPropertyAttribute.
/// </summary>
/// <seealso cref="Attribute" />
[global::System.CodeDom.Compiler.GeneratedCode("ReactiveUI.SourceGenerators.ObservableAsPropertyGenerator", "1.1.0.0")]
[AttributeUsage(AttributeTargets.Field | AttributeTargets.Property | AttributeTargets.Method, AllowMultiple = false, Inherited = false)]
internal sealed class ObservableAsPropertyAttribute : Attribute
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ namespace TestNs
/// </summary>
public partial class TestVM
{
[global::System.CodeDom.Compiler.GeneratedCode("ReactiveUI.SourceGenerators.ObservableAsPropertyGenerator", "1.1.0.0")]
/// <inheritdoc cref="Test5Property"/>
private int _test5Property;

Expand All @@ -24,7 +23,6 @@ public partial class TestVM
[global::System.Text.Json.Serialization.JsonIncludeAttribute()]
public int Test5Property { get => _test5Property = _test5PropertyHelper?.Value ?? _test5Property; }

[global::System.CodeDom.Compiler.GeneratedCode("ReactiveUI.SourceGenerators.ObservableAsPropertyGenerator", "1.1.0.0")]
[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage]
protected void InitializeOAPH()
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ namespace ReactiveUI.SourceGenerators;
/// ObservableAsPropertyAttribute.
/// </summary>
/// <seealso cref="Attribute" />
[global::System.CodeDom.Compiler.GeneratedCode("ReactiveUI.SourceGenerators.ObservableAsPropertyGenerator", "1.1.0.0")]
[AttributeUsage(AttributeTargets.Field | AttributeTargets.Property | AttributeTargets.Method, AllowMultiple = false, Inherited = false)]
internal sealed class ObservableAsPropertyAttribute : Attribute
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ namespace TestNs
/// </summary>
public partial class TestVM
{
[global::System.CodeDom.Compiler.GeneratedCode("ReactiveUI.SourceGenerators.ObservableAsPropertyGenerator", "1.1.0.0")]
/// <inheritdoc cref="Test4Property"/>
private int _test4Property;

Expand All @@ -23,7 +22,6 @@ public partial class TestVM
[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage]
public int Test4Property { get => _test4Property = _test4PropertyHelper?.Value ?? _test4Property; }

[global::System.CodeDom.Compiler.GeneratedCode("ReactiveUI.SourceGenerators.ObservableAsPropertyGenerator", "1.1.0.0")]
[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage]
protected void InitializeOAPH()
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ namespace ReactiveUI.SourceGenerators;
/// ObservableAsPropertyAttribute.
/// </summary>
/// <seealso cref="Attribute" />
[global::System.CodeDom.Compiler.GeneratedCode("ReactiveUI.SourceGenerators.ObservableAsPropertyGenerator", "1.1.0.0")]
[AttributeUsage(AttributeTargets.Field | AttributeTargets.Property | AttributeTargets.Method, AllowMultiple = false, Inherited = false)]
internal sealed class ObservableAsPropertyAttribute : Attribute
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ namespace TestNs
/// <inheritdoc/>
public partial class TestVM
{
[global::System.CodeDom.Compiler.GeneratedCode("ReactiveUI.SourceGenerators.ObservableAsPropertyGenerator", "1.1.0.0")]
/// <inheritdoc cref="_test1Helper"/>
private readonly ReactiveUI.ObservableAsPropertyHelper<int> _test1Helper;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ namespace ReactiveUI.SourceGenerators;
/// ObservableAsPropertyAttribute.
/// </summary>
/// <seealso cref="Attribute" />
[global::System.CodeDom.Compiler.GeneratedCode("ReactiveUI.SourceGenerators.ObservableAsPropertyGenerator", "1.1.0.0")]
[AttributeUsage(AttributeTargets.Field | AttributeTargets.Property | AttributeTargets.Method, AllowMultiple = false, Inherited = false)]
internal sealed class ObservableAsPropertyAttribute : Attribute
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ namespace TestNs
/// <inheritdoc/>
public partial class TestVM
{
[global::System.CodeDom.Compiler.GeneratedCode("ReactiveUI.SourceGenerators.ObservableAsPropertyGenerator", "1.1.0.0")]
/// <inheritdoc cref="_test2Helper"/>
private readonly ReactiveUI.ObservableAsPropertyHelper<int> _test2Helper;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ namespace ReactiveUI.SourceGenerators;
/// ObservableAsPropertyAttribute.
/// </summary>
/// <seealso cref="Attribute" />
[global::System.CodeDom.Compiler.GeneratedCode("ReactiveUI.SourceGenerators.ObservableAsPropertyGenerator", "1.1.0.0")]
[AttributeUsage(AttributeTargets.Field | AttributeTargets.Property | AttributeTargets.Method, AllowMultiple = false, Inherited = false)]
internal sealed class ObservableAsPropertyAttribute : Attribute
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ namespace TestNs
/// <inheritdoc/>
public partial class TestVM
{
[global::System.CodeDom.Compiler.GeneratedCode("ReactiveUI.SourceGenerators.ObservableAsPropertyGenerator", "1.1.0.0")]
/// <inheritdoc cref="_test2Helper"/>
private readonly ReactiveUI.ObservableAsPropertyHelper<int> _test2Helper;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ namespace ReactiveUI.SourceGenerators;
/// ReactiveAttribute.
/// </summary>
/// <seealso cref="Attribute" />
[global::System.CodeDom.Compiler.GeneratedCode("ReactiveUI.SourceGenerators.ReactiveGenerator", "1.1.0.0")]
[AttributeUsage(AttributeTargets.Field, AllowMultiple = false, Inherited = false)]
internal sealed class ReactiveAttribute : Attribute
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ namespace TestNs
/// </summary>
public partial class TestVM
{
[global::System.CodeDom.Compiler.GeneratedCode("ReactiveUI.SourceGenerators.ReactiveGenerator", "1.1.0.0")]
/// <inheritdoc cref="_test3"/>
[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage]
[global::System.Runtime.Serialization.DataMemberAttribute()]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ namespace ReactiveUI.SourceGenerators;
/// ReactiveAttribute.
/// </summary>
/// <seealso cref="Attribute" />
[global::System.CodeDom.Compiler.GeneratedCode("ReactiveUI.SourceGenerators.ReactiveGenerator", "1.1.0.0")]
[AttributeUsage(AttributeTargets.Field, AllowMultiple = false, Inherited = false)]
internal sealed class ReactiveAttribute : Attribute
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ namespace TestNs
/// </summary>
public partial class TestVM
{
[global::System.CodeDom.Compiler.GeneratedCode("ReactiveUI.SourceGenerators.ReactiveGenerator", "1.1.0.0")]
/// <inheritdoc cref="_test1"/>
[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage]
public int Test1
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ namespace ReactiveUI.SourceGenerators;
/// ReactiveAttribute.
/// </summary>
/// <seealso cref="Attribute" />
[global::System.CodeDom.Compiler.GeneratedCode("ReactiveUI.SourceGenerators.ReactiveGenerator", "1.1.0.0")]
[AttributeUsage(AttributeTargets.Field, AllowMultiple = false, Inherited = false)]
internal sealed class ReactiveAttribute : Attribute
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ namespace TestNs
/// </summary>
public partial class TestVM
{
[global::System.CodeDom.Compiler.GeneratedCode("ReactiveUI.SourceGenerators.ReactiveGenerator", "1.1.0.0")]
/// <inheritdoc cref="_test2"/>
[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage]
public int Test2
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ namespace ReactiveUI.SourceGenerators;
/// ReativeCommandAttribute.
/// </summary>
/// <seealso cref="Attribute" />
[global::System.CodeDom.Compiler.GeneratedCode("ReactiveUI.SourceGenerators.ReactiveCommandGenerator", "1.1.0.0")]
[AttributeUsage(AttributeTargets.Method, AllowMultiple = false, Inherited = false)]
internal sealed class ReactiveCommandAttribute : Attribute
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ namespace ReactiveUI.SourceGenerators;
/// ReativeCommandAttribute.
/// </summary>
/// <seealso cref="Attribute" />
[global::System.CodeDom.Compiler.GeneratedCode("ReactiveUI.SourceGenerators.ReactiveCommandGenerator", "1.1.0.0")]
[AttributeUsage(AttributeTargets.Method, AllowMultiple = false, Inherited = false)]
internal sealed class ReactiveCommandAttribute : Attribute
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ namespace ReactiveUI.SourceGenerators;
/// ReativeCommandAttribute.
/// </summary>
/// <seealso cref="Attribute" />
[global::System.CodeDom.Compiler.GeneratedCode("ReactiveUI.SourceGenerators.ReactiveCommandGenerator", "1.1.0.0")]
[AttributeUsage(AttributeTargets.Method, AllowMultiple = false, Inherited = false)]
internal sealed class ReactiveCommandAttribute : Attribute
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ namespace ReactiveUI.SourceGenerators;
/// ReativeCommandAttribute.
/// </summary>
/// <seealso cref="Attribute" />
[global::System.CodeDom.Compiler.GeneratedCode("ReactiveUI.SourceGenerators.ReactiveCommandGenerator", "1.1.0.0")]
[AttributeUsage(AttributeTargets.Method, AllowMultiple = false, Inherited = false)]
internal sealed class ReactiveCommandAttribute : Attribute
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for full license information.

using Microsoft.CodeAnalysis;
using ReactiveUI.SourceGenerators;
using Xunit.Abstractions;

Expand Down Expand Up @@ -41,7 +42,7 @@ public partial class TestVM : ReactiveObject
var driver = TestHelper.TestPass(sourceCode);

// Assert: Verify the generated code.
return Verify(driver).UseDirectory(TestHelper.VerifiedFilePath());
return VerifyGenerator(driver);
}

/// <summary>
Expand Down Expand Up @@ -71,7 +72,7 @@ public partial class TestVM : ReactiveObject
var driver = TestHelper.TestPass(sourceCode);

// Assert: Verify the generated code.
return Verify(driver).UseDirectory(TestHelper.VerifiedFilePath());
return VerifyGenerator(driver);
}

/// <summary>
Expand Down Expand Up @@ -101,7 +102,7 @@ public partial class TestVM : ReactiveObject
var driver = TestHelper.TestPass(sourceCode);

// Assert: Verify the generated code.
return Verify(driver).UseDirectory(TestHelper.VerifiedFilePath());
return VerifyGenerator(driver);
}

/// <summary>
Expand Down Expand Up @@ -131,7 +132,7 @@ public partial class TestVM : ReactiveObject
var driver = TestHelper.TestPass(sourceCode);

// Assert: Verify the generated code.
return Verify(driver).UseDirectory(TestHelper.VerifiedFilePath());
return VerifyGenerator(driver);
}

/// <summary>
Expand Down Expand Up @@ -165,6 +166,8 @@ public partial class TestVM : ReactiveObject
var driver = TestHelper.TestPass(sourceCode);

// Assert: Verify the generated code.
return Verify(driver).UseDirectory(TestHelper.VerifiedFilePath());
return VerifyGenerator(driver);
}

private SettingsTask VerifyGenerator(GeneratorDriver driver) => Verify(driver).UseDirectory(TestHelper.VerifiedFilePath()).ScrubLinesContaining("[global::System.CodeDom.Compiler.GeneratedCode(\"");
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for full license information.

using Microsoft.CodeAnalysis;
using ReactiveUI.SourceGenerators;
using Xunit.Abstractions;

Expand Down Expand Up @@ -41,7 +42,7 @@ public partial class TestVM : ReactiveObject
var driver = TestHelper.TestPass(sourceCode);

// Assert: Verify the generated code.
return Verify(driver).UseDirectory(TestHelper.VerifiedFilePath());
return VerifyGenerator(driver);
}

/// <summary>
Expand Down Expand Up @@ -71,7 +72,7 @@ public partial class TestVM : ReactiveObject
var driver = TestHelper.TestPass(sourceCode);

// Assert: Verify the generated code.
return Verify(driver).UseDirectory(TestHelper.VerifiedFilePath());
return VerifyGenerator(driver);
}

/// <summary>
Expand Down Expand Up @@ -101,6 +102,8 @@ public partial class TestVM : ReactiveObject
var driver = TestHelper.TestPass(sourceCode);

// Assert: Verify the generated code.
return Verify(driver).UseDirectory(TestHelper.VerifiedFilePath());
return VerifyGenerator(driver);
}

private SettingsTask VerifyGenerator(GeneratorDriver driver) => Verify(driver).UseDirectory(TestHelper.VerifiedFilePath()).ScrubLinesContaining("[global::System.CodeDom.Compiler.GeneratedCode(\"");
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for full license information.

using Microsoft.CodeAnalysis;
using ReactiveUI.SourceGenerators;
using Xunit.Abstractions;

Expand Down Expand Up @@ -42,7 +43,7 @@ public partial class TestVM : ReactiveObject
var driver = TestHelper.TestPass(sourceCode);

// Assert: Verify the generated code.
return Verify(driver).UseDirectory(TestHelper.VerifiedFilePath());
return VerifyGenerator(driver);
}

/// <summary>
Expand Down Expand Up @@ -74,7 +75,7 @@ public partial class TestVM : ReactiveObject
var driver = TestHelper.TestPass(sourceCode);

// Assert: Verify the generated code.
return Verify(driver).UseDirectory(TestHelper.VerifiedFilePath());
return VerifyGenerator(driver);
}

/// <summary>
Expand Down Expand Up @@ -108,7 +109,7 @@ private async Task Test1()
var driver = TestHelper.TestPass(sourceCode);

// Assert: Verify the generated code.
return Verify(driver).UseDirectory(TestHelper.VerifiedFilePath());
return VerifyGenerator(driver);
}

/// <summary>
Expand Down Expand Up @@ -143,6 +144,8 @@ private async Task Test3(string baseString)
var driver = TestHelper.TestPass(sourceCode);

// Assert: Verify the generated code.
return Verify(driver).UseDirectory(TestHelper.VerifiedFilePath());
return VerifyGenerator(driver);
}

private SettingsTask VerifyGenerator(GeneratorDriver driver) => Verify(driver).UseDirectory(TestHelper.VerifiedFilePath()).ScrubLinesContaining("[global::System.CodeDom.Compiler.GeneratedCode(\"");
}
Loading

0 comments on commit c8dc8ca

Please sign in to comment.