Skip to content

Commit

Permalink
Added Single line documentation test
Browse files Browse the repository at this point in the history
  • Loading branch information
FaustVX committed May 18, 2024
1 parent b5d1d3d commit 3e828bb
Show file tree
Hide file tree
Showing 6 changed files with 85 additions and 0 deletions.
13 changes: 13 additions & 0 deletions PrimaryParameter.Tests/PrimaryParameterSnapshotTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -263,4 +263,17 @@ public class C([DoNotUse] int i);
// Pass the source code to our helper and snapshot test the output
return TestHelper.Verify(source);
}

[Fact]
public Task GenerateSingleLineDocumentation()
{
// The source code to test
var source = """
using PrimaryParameter.SG;
public class C([Property(Summary = "Documentation")] int i);
""";

// Pass the source code to our helper and snapshot test the output
return TestHelper.Verify(source);
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
//HintName: DoNotUseAttribute.g.cs
#pragma warning disable
// <auto-generated/>
using global::System;
namespace PrimaryParameter.SG
{
[AttributeUsage(AttributeTargets.Parameter, Inherited = false, AllowMultiple = false)]
sealed class DoNotUseAttribute : Attribute
{
public bool AllowInMemberInit { get; init; }
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
//HintName: FaustVX.PrimaryParameter.SG.g.cs
#pragma warning disable
// <auto-generated/>
partial class C
{
/// <summary>
/// Documentation
/// </summary>
public int I { get; } = i;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
//HintName: FieldAttribute.g.cs
#pragma warning disable
// <auto-generated/>
using global::System;
namespace PrimaryParameter.SG
{
[AttributeUsage(AttributeTargets.Parameter, Inherited = false, AllowMultiple = true)]
sealed class FieldAttribute : Attribute
{
public string Name { get; init; }
public string AssignFormat { get; init; }
public Type Type { get; init; }
public bool IsReadonly { get; init; }
public string Scope { get; init; }
public string Summary { get; init; }
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
//HintName: PropertyAttribute.g.cs
#pragma warning disable
// <auto-generated/>
using global::System;
namespace PrimaryParameter.SG
{
[AttributeUsage(AttributeTargets.Parameter, Inherited = false, AllowMultiple = true)]
sealed class PropertyAttribute : Attribute
{
public string Name { get; init; }
public string AssignFormat { get; init; }
public Type Type { get; init; }
public string Setter { get; init; }
public string Scope { get; init; }
public string Summary { get; init; }
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
//HintName: RefFieldAttribute.g.cs
#pragma warning disable
// <auto-generated/>
using global::System;
namespace PrimaryParameter.SG
{
[AttributeUsage(AttributeTargets.Parameter, Inherited = false, AllowMultiple = true)]
sealed class RefFieldAttribute : Attribute
{
public string Name { get; init; }
public string Scope { get; init; }
public bool IsReadonlyRef { get; init; }
public bool IsRefReadonly { get; init; }
public string Summary { get; init; }
}
}

0 comments on commit 3e828bb

Please sign in to comment.