Skip to content

Commit bf7cb39

Browse files
committed
Added .Count to name part of the string
1 parent 1f398cf commit bf7cb39

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

src/Atc.Rest.ApiGenerator/ProjectSyntaxFactories/SyntaxMethodDeclarationFactory.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ public static MethodDeclarationSyntax CreateInterfaceMethod(string parameterType
7171
if (isArray)
7272
{
7373
content.Add(SyntaxInterpolatedFactory.CreateNameOf(name));
74-
content.Add(SyntaxInterpolatedFactory.StringTextColon());
74+
content.Add(SyntaxInterpolatedFactory.StringText(".Count: "));
7575
var countCoalesceExpression = SyntaxFactory.ParseExpression($"{name}?.Count ?? 0");
7676
content.Add(SyntaxFactory.Interpolation(countCoalesceExpression));
7777
}

test/Atc.Rest.ApiGenerator.Tests/SyntaxGenerators/Api/XUnitTestData/ContractModel/collectionToStringCount.verified.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ public class TestComponent
2424
/// </summary>
2525
public override string ToString()
2626
{
27-
return $"{nameof(Foos)}: {Foos?.Count ?? 0}, {nameof(NullableFoos)}: {NullableFoos?.Count ?? 0}";
27+
return $"{nameof(Foos)}.Count: {Foos?.Count ?? 0}, {nameof(NullableFoos)}.Count: {NullableFoos?.Count ?? 0}";
2828
}
2929
}
3030
}

test/Atc.Rest.ApiGenerator.Tests/SyntaxGenerators/Api/XUnitTestData/ContractModel/requiredArrayComponent.verified.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ public class RequiredArrayComponent
2424
/// </summary>
2525
public override string ToString()
2626
{
27-
return $"{nameof(MyItems)}: {MyItems?.Count ?? 0}";
27+
return $"{nameof(MyItems)}.Count: {MyItems?.Count ?? 0}";
2828
}
2929
}
3030
}

0 commit comments

Comments
 (0)