Skip to content

Commit

Permalink
chore: Simplify test function
Browse files Browse the repository at this point in the history
  • Loading branch information
MH321Productions committed Nov 11, 2024
1 parent a03f31a commit 8294768
Showing 1 changed file with 2 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -135,15 +135,10 @@ public async Task WhenIdentitySendsAGetRequestToTheTokensIdEndpointWithPassword(
[When($@"{RegexFor.OPTIONAL_SINGLE_THING} sends a GET request to the /Tokens/{RegexFor.SINGLE_THING}.Id endpoint")]
public async Task WhenIdentitySendsAGetRequestToTheTokensIdEndpoint(string identityName, string tokenName)
{
var isAuthenticated = identityName != "-";

var client = isAuthenticated ? _clientPool.FirstForIdentityName(identityName) : _clientPool.Anonymous;
var client = _clientPool.FirstForIdentityName(identityName);
var tokenId = _tokensContext.CreateTokenResponses[tokenName].Id;

if (isAuthenticated)
_responseContext.WhenResponse = await client.Tokens.GetToken(tokenId);
else
_responseContext.WhenResponse = await client.Tokens.GetTokenUnauthenticated(tokenId);
_responseContext.WhenResponse = await client.Tokens.GetToken(tokenId);
}

[When($@"{RegexFor.SINGLE_THING} sends a GET request to the /Tokens endpoint with the following payloads")]
Expand Down

0 comments on commit 8294768

Please sign in to comment.