Skip to content

Commit

Permalink
chore: Use helper methods
Browse files Browse the repository at this point in the history
  • Loading branch information
MH321Productions committed Aug 26, 2024
1 parent a5a0361 commit 0b4c4c4
Showing 1 changed file with 2 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
using Backbone.ConsumerApi.Sdk.Endpoints.RelationshipTemplates.Types.Responses;
using Backbone.ConsumerApi.Tests.Integration.Configuration;
using Backbone.ConsumerApi.Tests.Integration.Extensions;
using Backbone.ConsumerApi.Tests.Integration.Helpers;
using Backbone.ConsumerApi.Tests.Integration.Support;
using Backbone.Tooling.Extensions;
using Microsoft.Extensions.Options;
Expand Down Expand Up @@ -73,11 +74,7 @@ public async Task GivenAPendingRelationshipBetweenI1AndI2CreatedByI1()
[Given("an active Relationship between i1 and i2 created by i1")]
public async Task GivenAnActiveRelationshipBetweenI1AndI2()
{
var relationshipTemplateResponse = await CreateRelationshipTemplate(_client1);
var createRelationshipResponse = await CreateRelationship(_client2, relationshipTemplateResponse.Result!.Id);
var acceptRelationshipResponse = await AcceptRelationship(_client1, createRelationshipResponse.Result!.Id);

_relationshipId = acceptRelationshipResponse.Result!.Id;
_relationshipId = (await Utils.EstablishRelationshipBetween(_client1, _client2)).Id;
}

[Given("a rejected Relationship between i1 and i2 created by i1")]
Expand Down Expand Up @@ -264,15 +261,6 @@ private async Task<ApiResponse<RelationshipMetadata>> CreateRelationship(Client
return await client.Relationships.CreateRelationship(createRelationshipRequest);
}

private async Task<ApiResponse<RelationshipMetadata>> AcceptRelationship(Client client, string relationshipId)
{
var acceptRelationshipRequest = new AcceptRelationshipRequest
{
CreationResponseContent = "AAA".GetBytes()
};
return await client.Relationships.AcceptRelationship(relationshipId, acceptRelationshipRequest);
}

private async Task<ApiResponse<RelationshipMetadata>> RejectRelationship(Client client, string relationshipId)
{
var rejectRelationshipRequest = new RejectRelationshipRequest
Expand Down

0 comments on commit 0b4c4c4

Please sign in to comment.