Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 10 additions & 6 deletions src/Refitter.Tests/GenerateCommandTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -125,22 +125,26 @@ public void CreateRefitGeneratorSettings_Should_Map_PropertyNamingPolicy()
}

[Test]
public void Command_Should_Have_Public_Validate_Method()
public void Command_Should_Have_Protected_Validate_Method()
{
var command = new GenerateCommand();
var method = command.GetType().GetMethod("Validate");
var method = command.GetType().GetMethod(
"Validate",
System.Reflection.BindingFlags.Instance | System.Reflection.BindingFlags.NonPublic);

method.Should().NotBeNull();
method!.IsPublic.Should().BeTrue();
method!.IsFamily.Should().BeTrue();
}

[Test]
public void Command_Should_Have_Public_ExecuteAsync_Method()
public void Command_Should_Have_Protected_ExecuteAsync_Method()
{
var command = new GenerateCommand();
var method = command.GetType().GetMethod("ExecuteAsync");
var method = command.GetType().GetMethod(
"ExecuteAsync",
System.Reflection.BindingFlags.Instance | System.Reflection.BindingFlags.NonPublic);

method.Should().NotBeNull();
method!.IsPublic.Should().BeTrue();
method!.IsFamily.Should().BeTrue();
}
}
4 changes: 2 additions & 2 deletions src/Refitter/GenerateCommand.cs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ public sealed class GenerateCommand : AsyncCommand<Settings>

private static readonly string Crlf = Environment.NewLine;

public override ValidationResult Validate(CommandContext context, Settings settings)
protected override ValidationResult Validate(CommandContext context, Settings settings)
{
if (!settings.NoLogging)
Analytics.Configure();
Expand All @@ -35,7 +35,7 @@ public override ValidationResult Validate(CommandContext context, Settings setti
return SettingsValidator.Validate(settings);
}

public override async Task<int> ExecuteAsync(CommandContext context, Settings settings, CancellationToken cancellationToken)
protected override async Task<int> ExecuteAsync(CommandContext context, Settings settings, CancellationToken cancellationToken)
{
var refitGeneratorSettings = CreateRefitGeneratorSettings(settings);
try
Expand Down
2 changes: 1 addition & 1 deletion src/Refitter/Refitter.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
<ItemGroup>
<PackageReference Include="Exceptionless" Version="6.1.0" />
<PackageReference Include="Microsoft.ApplicationInsights.WindowsServer" Version="2.23.0" />
<PackageReference Include="Spectre.Console.Cli" Version="0.53.1" />
<PackageReference Include="Spectre.Console.Cli" Version="0.55.0" />
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="10.0.201" PrivateAssets="all" />
<PackageReference Include="System.Text.Json" Version="10.0.5" />
</ItemGroup>
Expand Down
Loading