Skip to content

Commit

Permalink
[.NET] Adopt c#12 collection initializers
Browse files Browse the repository at this point in the history
  • Loading branch information
Romfos committed Aug 27, 2024
1 parent 27b8853 commit 9deea73
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 13 deletions.
2 changes: 1 addition & 1 deletion dotnet/Gherkin/AstBuilder.cs
Original file line number Diff line number Diff line change
Expand Up @@ -258,7 +258,7 @@ private Tag[] GetTags(AstNode node)
{
var tagsNode = node.GetSingle<AstNode>(RuleType.Tags);
if (tagsNode == null)
return new Tag[0];
return [];

return tagsNode.GetTokens(TokenType.TagLine)
.SelectMany(t => t.MatchedItems, (t, tagItem) =>
Expand Down
22 changes: 11 additions & 11 deletions dotnet/Gherkin/GherkinDialectProvider.cs
Original file line number Diff line number Diff line change
Expand Up @@ -99,17 +99,17 @@ protected static GherkinDialect GetFactoryDefault()
{
return new GherkinDialect(
"en",
new[] { "Feature" },
new[] { "Rule" },
new[] { "Background" },
new[] { "Scenario" },
new[] { "Scenario Outline", "Scenario Template" },
new[] { "Examples", "Scenarios" },
new[] { "* ", "Given " },
new[] { "* ", "When " },
new[] { "* ", "Then " },
new[] { "* ", "And " },
new[] { "* ", "But " });
["Feature"],
["Rule"],
["Background"],
["Scenario"],
["Scenario Outline", "Scenario Template"],
["Examples", "Scenarios"],
["* ", "Given "],
["* ", "When "],
["* ", "Then "],
["* ", "And "],
["* ", "But "]);
}
}

Expand Down
2 changes: 1 addition & 1 deletion dotnet/Gherkin/GherkinLine.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ namespace Gherkin;

public class GherkinLine : IGherkinLine
{
private static char[] inlineWhitespaceChars = new char[] { ' ', '\t', '\u00A0' };
private static char[] inlineWhitespaceChars = [' ', '\t', '\u00A0'];

private readonly string lineText;
private readonly string trimmedLineText;
Expand Down

0 comments on commit 9deea73

Please sign in to comment.