Skip to content

Commit 069cbec

Browse files
committed
Issue #218 Address PR comments with minor updates to XUnit usage and removed unused code and out of date comments
1 parent b140a36 commit 069cbec

File tree

3 files changed

+4
-11
lines changed

3 files changed

+4
-11
lines changed

src/shared/Atlassian.Bitbucket.Tests/BitbucketAuthenticationTest.cs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,8 @@ public async Task BitbucketAuthentication_GetBasicCredentialsAsync_SucceedsAfter
2525
Assert.Equal(password, result.Password);
2626
}
2727

28-
[Theory]
29-
[InlineData("jsquire", "password")]
30-
public async Task BitbucketAuthentication_ShowOAuthRequiredPromptAsync_SucceedsAfterUserInput(string username, string password)
28+
[Fact]
29+
public async Task BitbucketAuthentication_ShowOAuthRequiredPromptAsync_SucceedsAfterUserInput()
3130
{
3231
var context = new TestCommandContext();
3332
context.Terminal.Prompts["Press enter to continue..."] = " ";

src/shared/Atlassian.Bitbucket.Tests/BitbucketHostProviderTest.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,15 +56,15 @@ public void BitbucketHostProvider_IsSupported_FailsForNullInput()
5656
{
5757
InputArguments input = null;
5858
var provider = new BitbucketHostProvider(new TestCommandContext());
59-
Assert.Equal(false, provider.IsSupported(input));
59+
Assert.False(provider.IsSupported(input));
6060
}
6161

6262
[Fact]
6363
public void BitbucketHostProvider_IsSupported_FailsForNullHttpResponseMessage()
6464
{
6565
HttpResponseMessage httpResponseMessage = null;
6666
var provider = new BitbucketHostProvider(new TestCommandContext());
67-
Assert.Equal(false, provider.IsSupported(httpResponseMessage));
67+
Assert.False(provider.IsSupported(httpResponseMessage));
6868
}
6969

7070
[Theory]

src/shared/Atlassian.Bitbucket/BitbucketHostProvider.cs

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -144,9 +144,6 @@ private async Task<ICredential> GetRefreshedCredentials(InputArguments input)
144144
// There is no refresh token either because this is a non-2FA enabled account (where OAuth is not
145145
// required), or because we previously erased the RT.
146146

147-
// Check for the presence of a credential in the store
148-
string credentialService = GetServiceName(input);
149-
150147
if (SupportsBasicAuth(authModes))
151148
{
152149
_context.Trace.WriteLine("Prompt for Basic Auth...");
@@ -181,9 +178,6 @@ private async Task<ICredential> GetRefreshedCredentials(InputArguments input)
181178
{
182179
_context.Trace.WriteLineSecrets($"Found stored refresh token: {{0}}", new object[] { refreshToken });
183180

184-
// It's very likely that any access token expired between the last time we used/stored it.
185-
// To ensure the AT is as 'fresh' as it can be, always first try to use the refresh token
186-
// (which lives longer) to create a new AT (and possibly also a new RT).
187181
try
188182
{
189183
return await GetOAuthCredentialsViaRefreshFlow(input, refreshToken);

0 commit comments

Comments
 (0)