Skip to content
Open
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
Original file line number Diff line number Diff line change
Expand Up @@ -49,11 +49,9 @@ public override async Task<CommandResponse> ExecuteAsync(CommandContext context,
var subscriptionService = context.GetService<ISubscriptionService>();
var subscriptions = await subscriptionService.GetSubscriptions(options.Tenant, options.RetryPolicy);

context.Response.Results = subscriptions?.Count > 0
? ResponseResult.Create(
context.Response.Results = ResponseResult.Create(
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for catching this! Just a nit change to follow all the other commands doing this:

context.Response.Results = ResponseResult.Create(new(subscriptions ?? []), SubscriptionJsonContext.Default.SubscriptionListCommandResult);

new SubscriptionListCommandResult(subscriptions),
SubscriptionJsonContext.Default.SubscriptionListCommandResult)
: null;
SubscriptionJsonContext.Default.SubscriptionListCommandResult);
}
catch (Exception ex)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ await _subscriptionService.Received(1).GetSubscriptions(
}

[Fact]
public async Task ExecuteAsync_EmptySubscriptionList_ReturnsNullResults()
public async Task ExecuteAsync_EmptySubscriptionList_ReturnsNotNullResults()
{
// Arrange
_subscriptionService
Expand All @@ -120,7 +120,7 @@ public async Task ExecuteAsync_EmptySubscriptionList_ReturnsNullResults()
// Assert
Assert.NotNull(result);
Assert.Equal(200, result.Status);
Assert.Null(result.Results);
Assert.NotNull(result.Results);
}

[Fact]
Expand Down