Skip to content

Commit 500c81e

Browse files
committed
(maint) Be consistent about Async suffix
Almost all of the code in GitReleaseManager uses the Async suffix for methods that return a Task, but there were a couple that wasn't doing that. This commit addresses that by making sure that we are consistent everywhere.
1 parent ef29914 commit 500c81e

32 files changed

+51
-51
lines changed

src/GitReleaseManager.Cli/Program.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -192,7 +192,7 @@ private static Task<int> ExecuteCommand<TOptions>(TOptions options)
192192
where TOptions : BaseSubOptions
193193
{
194194
var command = _serviceProvider.GetRequiredService<ICommand<TOptions>>();
195-
return command.Execute(options);
195+
return command.ExecuteAsync(options);
196196
}
197197

198198
private static void LogOptions(BaseSubOptions options)

src/GitReleaseManager.Core.Tests/Commands/AddAssetsCommandTests.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ public async Task Should_Execute_Command()
3838
_vcsService.AddAssetsAsync(options.RepositoryOwner, options.RepositoryName, options.TagName, options.AssetPaths).
3939
Returns(Task.CompletedTask);
4040

41-
var result = await _command.Execute(options).ConfigureAwait(false);
41+
var result = await _command.ExecuteAsync(options).ConfigureAwait(false);
4242
result.ShouldBe(0);
4343

4444
await _vcsService.Received(1).AddAssetsAsync(options.RepositoryOwner, options.RepositoryName, options.TagName, options.AssetPaths).ConfigureAwait(false);

src/GitReleaseManager.Core.Tests/Commands/CloseCommandTests.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ public async Task Should_Execute_Command()
3636
_vcsService.CloseMilestoneAsync(options.RepositoryOwner, options.RepositoryName, options.Milestone)
3737
.Returns(Task.CompletedTask);
3838

39-
var result = await _command.Execute(options).ConfigureAwait(false);
39+
var result = await _command.ExecuteAsync(options).ConfigureAwait(false);
4040
result.ShouldBe(0);
4141

4242
await _vcsService.Received(1).CloseMilestoneAsync(options.RepositoryOwner, options.RepositoryName, options.Milestone).ConfigureAwait(false);

src/GitReleaseManager.Core.Tests/Commands/CreateCommandTests.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ public async Task Should_Create_Empty_Release()
4343
_vcsService.CreateEmptyReleaseAsync(options.RepositoryOwner, options.RepositoryName, options.Name, options.TargetCommitish, options.Prerelease)
4444
.Returns(_release);
4545

46-
var result = await _command.Execute(options).ConfigureAwait(false);
46+
var result = await _command.ExecuteAsync(options).ConfigureAwait(false);
4747
result.ShouldBe(0);
4848

4949
await _vcsService.Received(1).CreateEmptyReleaseAsync(options.RepositoryOwner, options.RepositoryName, releaseName, options.TargetCommitish, options.Prerelease).ConfigureAwait(false);
@@ -72,7 +72,7 @@ public async Task Should_Create_Release_From_Milestone(string name, int logVerbo
7272
_vcsService.CreateReleaseFromMilestoneAsync(options.RepositoryOwner, options.RepositoryName, options.Milestone, releaseName, options.TargetCommitish, options.AssetPaths, options.Prerelease, options.Template)
7373
.Returns(_release);
7474

75-
var result = await _command.Execute(options).ConfigureAwait(false);
75+
var result = await _command.ExecuteAsync(options).ConfigureAwait(false);
7676
result.ShouldBe(0);
7777

7878
await _vcsService.Received(1).CreateReleaseFromMilestoneAsync(options.RepositoryOwner, options.RepositoryName, options.Milestone, releaseName, options.TargetCommitish, options.AssetPaths, options.Prerelease, options.Template).ConfigureAwait(false);
@@ -98,7 +98,7 @@ public async Task Should_Create_Release_From_InputFile()
9898
_vcsService.CreateReleaseFromInputFileAsync(options.RepositoryOwner, options.RepositoryName, options.Name, options.InputFilePath, options.TargetCommitish, options.AssetPaths, options.Prerelease)
9999
.Returns(_release);
100100

101-
var result = await _command.Execute(options).ConfigureAwait(false);
101+
var result = await _command.ExecuteAsync(options).ConfigureAwait(false);
102102
result.ShouldBe(0);
103103

104104
await _vcsService.Received(1).CreateReleaseFromInputFileAsync(options.RepositoryOwner, options.RepositoryName, options.Name, options.InputFilePath, options.TargetCommitish, options.AssetPaths, options.Prerelease).ConfigureAwait(false);

src/GitReleaseManager.Core.Tests/Commands/DiscardCommandTests.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ public async Task Should_Execute_Command()
3636
_vcsService.DiscardReleaseAsync(options.RepositoryOwner, options.RepositoryName, options.Milestone)
3737
.Returns(Task.CompletedTask);
3838

39-
var result = await _command.Execute(options).ConfigureAwait(false);
39+
var result = await _command.ExecuteAsync(options).ConfigureAwait(false);
4040
result.ShouldBe(0);
4141

4242
await _vcsService.Received(1).DiscardReleaseAsync(options.RepositoryOwner, options.RepositoryName, options.Milestone).ConfigureAwait(false);

src/GitReleaseManager.Core.Tests/Commands/ExportCommandTests.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ public async Task Should_Execute_Command()
4242
_vcsService.ExportReleasesAsync(options.RepositoryOwner, options.RepositoryName, options.TagName, options.SkipPrereleases)
4343
.Returns(releaseText);
4444

45-
var result = await _command.Execute(options).ConfigureAwait(false);
45+
var result = await _command.ExecuteAsync(options).ConfigureAwait(false);
4646
result.ShouldBe(0);
4747

4848
var exportFileExists = File.Exists(_fileOutputPath);

src/GitReleaseManager.Core.Tests/Commands/InitCommandTests.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ public async Task Should_Execute_Command()
4040
{
4141
var options = new InitSubOptions { TargetDirectory = _targetDirectory };
4242

43-
var result = await _command.Execute(options).ConfigureAwait(false);
43+
var result = await _command.ExecuteAsync(options).ConfigureAwait(false);
4444
result.ShouldBe(0);
4545

4646
var configFilePath = Path.Combine(_targetDirectory, "GitReleaseManager.yml");
@@ -70,7 +70,7 @@ public async Task Should_Not_Execute_Command_For_Legacy_FileName()
7070
File.WriteAllText(configFilePath, "s");
7171
var expectedHash = GetHash(configFilePath);
7272

73-
var result = await _command.Execute(options).ConfigureAwait(false);
73+
var result = await _command.ExecuteAsync(options).ConfigureAwait(false);
7474
result.ShouldBe(0); // Should this perhaps return 1
7575

7676
var actualHash = GetHash(configFilePath);

src/GitReleaseManager.Core.Tests/Commands/LabelCommandTests.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ public async Task Should_Execute_Command()
3535
_vcsService.CreateLabelsAsync(options.RepositoryOwner, options.RepositoryName)
3636
.Returns(Task.CompletedTask);
3737

38-
var result = await _command.Execute(options).ConfigureAwait(false);
38+
var result = await _command.ExecuteAsync(options).ConfigureAwait(false);
3939
result.ShouldBe(0);
4040

4141
await _vcsService.Received(1).CreateLabelsAsync(options.RepositoryOwner, options.RepositoryName).ConfigureAwait(false);

src/GitReleaseManager.Core.Tests/Commands/OpenCommandTests.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ public async Task Should_Execute_Command()
3636
_vcsService.OpenMilestoneAsync(options.RepositoryOwner, options.RepositoryName, options.Milestone)
3737
.Returns(Task.CompletedTask);
3838

39-
var result = await _command.Execute(options).ConfigureAwait(false);
39+
var result = await _command.ExecuteAsync(options).ConfigureAwait(false);
4040
result.ShouldBe(0);
4141

4242
await _vcsService.Received(1).OpenMilestoneAsync(options.RepositoryOwner, options.RepositoryName, options.Milestone).ConfigureAwait(false);

src/GitReleaseManager.Core.Tests/Commands/PublishCommandTests.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ public async Task Should_Execute_Command()
3636
_vcsService.PublishReleaseAsync(options.RepositoryOwner, options.RepositoryName, options.TagName)
3737
.Returns(Task.CompletedTask);
3838

39-
var result = await _command.Execute(options).ConfigureAwait(false);
39+
var result = await _command.ExecuteAsync(options).ConfigureAwait(false);
4040
result.ShouldBe(0);
4141

4242
await _vcsService.Received(1).PublishReleaseAsync(options.RepositoryOwner, options.RepositoryName, options.TagName).ConfigureAwait(false);

0 commit comments

Comments
 (0)