@@ -13,7 +13,7 @@ namespace GitHub.Tests
13
13
public class GitHubHostProviderTests
14
14
{
15
15
[ Fact ]
16
- public void GitHubProvider_IsSupported_GitHubHost_UnencryptedHttp_ReturnsTrue ( )
16
+ public void GitHubHostProvider_IsSupported_GitHubHost_UnencryptedHttp_ReturnsTrue ( )
17
17
{
18
18
var input = new InputArguments ( new Dictionary < string , string >
19
19
{
@@ -29,7 +29,7 @@ public void GitHubProvider_IsSupported_GitHubHost_UnencryptedHttp_ReturnsTrue()
29
29
}
30
30
31
31
[ Fact ]
32
- public void GitHubProvider_IsSupported_GistHost_UnencryptedHttp_ReturnsTrue ( )
32
+ public void GitHubHostProvider_IsSupported_GistHost_UnencryptedHttp_ReturnsTrue ( )
33
33
{
34
34
var input = new InputArguments ( new Dictionary < string , string >
35
35
{
@@ -45,7 +45,7 @@ public void GitHubProvider_IsSupported_GistHost_UnencryptedHttp_ReturnsTrue()
45
45
}
46
46
47
47
[ Fact ]
48
- public void GitHubProvider_IsSupported_GitHubHost_Https_ReturnsTrue ( )
48
+ public void GitHubHostProvider_IsSupported_GitHubHost_Https_ReturnsTrue ( )
49
49
{
50
50
var input = new InputArguments ( new Dictionary < string , string >
51
51
{
@@ -59,7 +59,7 @@ public void GitHubProvider_IsSupported_GitHubHost_Https_ReturnsTrue()
59
59
}
60
60
61
61
[ Fact ]
62
- public void GitHubProvider_IsSupported_GistHost_Https_ReturnsTrue ( )
62
+ public void GitHubHostProvider_IsSupported_GistHost_Https_ReturnsTrue ( )
63
63
{
64
64
var input = new InputArguments ( new Dictionary < string , string >
65
65
{
@@ -73,7 +73,7 @@ public void GitHubProvider_IsSupported_GistHost_Https_ReturnsTrue()
73
73
}
74
74
75
75
[ Fact ]
76
- public void GitHubProvider_IsSupported_NonHttpHttps_ReturnsTrue ( )
76
+ public void GitHubHostProvider_IsSupported_NonHttpHttps_ReturnsTrue ( )
77
77
{
78
78
var input = new InputArguments ( new Dictionary < string , string >
79
79
{
@@ -87,7 +87,7 @@ public void GitHubProvider_IsSupported_NonHttpHttps_ReturnsTrue()
87
87
}
88
88
89
89
[ Fact ]
90
- public void GitHubProvider_IsSupported_NonGitHub_ReturnsFalse ( )
90
+ public void GitHubHostProvider_IsSupported_NonGitHub_ReturnsFalse ( )
91
91
{
92
92
var input = new InputArguments ( new Dictionary < string , string >
93
93
{
@@ -100,7 +100,7 @@ public void GitHubProvider_IsSupported_NonGitHub_ReturnsFalse()
100
100
}
101
101
102
102
[ Fact ]
103
- public void GitHubProvider_GetCredentialKey_GitHubHost_ReturnsCorrectKey ( )
103
+ public void GitHubHostProvider_GetCredentialKey_GitHubHost_ReturnsCorrectKey ( )
104
104
{
105
105
const string expectedKey = "https://github.com" ;
106
106
var input = new InputArguments ( new Dictionary < string , string >
@@ -115,7 +115,7 @@ public void GitHubProvider_GetCredentialKey_GitHubHost_ReturnsCorrectKey()
115
115
}
116
116
117
117
[ Fact ]
118
- public void GitHubProvider_GetCredentialKey_GistHost_ReturnsCorrectKey ( )
118
+ public void GitHubHostProvider_GetCredentialKey_GistHost_ReturnsCorrectKey ( )
119
119
{
120
120
const string expectedKey = "https://github.com" ;
121
121
var input = new InputArguments ( new Dictionary < string , string >
@@ -130,7 +130,7 @@ public void GitHubProvider_GetCredentialKey_GistHost_ReturnsCorrectKey()
130
130
}
131
131
132
132
[ Fact ]
133
- public async Task GitHubProvider_CreateCredentialAsync_UnencryptedHttp_ThrowsException ( )
133
+ public async Task GitHubHostProvider_CreateCredentialAsync_UnencryptedHttp_ThrowsException ( )
134
134
{
135
135
var input = new InputArguments ( new Dictionary < string , string >
136
136
{
@@ -148,7 +148,7 @@ public async Task GitHubProvider_CreateCredentialAsync_UnencryptedHttp_ThrowsExc
148
148
}
149
149
150
150
[ Fact ]
151
- public async Task GitHubProvider_CreateCredentialAsync_1FAOnly_ReturnsCredential ( )
151
+ public async Task GitHubHostProvider_CreateCredentialAsync_1FAOnly_ReturnsCredential ( )
152
152
{
153
153
var input = new InputArguments ( new Dictionary < string , string >
154
154
{
@@ -172,8 +172,8 @@ public async Task GitHubProvider_CreateCredentialAsync_1FAOnly_ReturnsCredential
172
172
var context = new TestCommandContext ( ) ;
173
173
174
174
var ghAuthMock = new Mock < IGitHubAuthentication > ( MockBehavior . Strict ) ;
175
- ghAuthMock . Setup ( x => x . TryGetCredentials ( expectedTargetUri , out expectedUserName , out expectedPassword ) )
176
- . Returns ( true ) ;
175
+ ghAuthMock . Setup ( x => x . GetCredentialsAsync ( expectedTargetUri ) )
176
+ . ReturnsAsync ( new GitCredential ( expectedUserName , expectedPassword ) ) ;
177
177
178
178
var ghApiMock = new Mock < IGitHubRestApi > ( MockBehavior . Strict ) ;
179
179
ghApiMock . Setup ( x => x . AcquireTokenAsync ( expectedTargetUri , expectedUserName , expectedPassword , null , It . IsAny < IEnumerable < string > > ( ) ) )
@@ -189,7 +189,7 @@ public async Task GitHubProvider_CreateCredentialAsync_1FAOnly_ReturnsCredential
189
189
}
190
190
191
191
[ Fact ]
192
- public async Task GitHubProvider_CreateCredentialAsync_2FARequired_ReturnsCredential ( )
192
+ public async Task GitHubHostProvider_CreateCredentialAsync_2FARequired_ReturnsCredential ( )
193
193
{
194
194
var input = new InputArguments ( new Dictionary < string , string >
195
195
{
@@ -215,10 +215,10 @@ public async Task GitHubProvider_CreateCredentialAsync_2FARequired_ReturnsCreden
215
215
var context = new TestCommandContext ( ) ;
216
216
217
217
var ghAuthMock = new Mock < IGitHubAuthentication > ( MockBehavior . Strict ) ;
218
- ghAuthMock . Setup ( x => x . TryGetCredentials ( expectedTargetUri , out expectedUserName , out expectedPassword ) )
219
- . Returns ( true ) ;
220
- ghAuthMock . Setup ( x => x . TryGetAuthenticationCode ( expectedTargetUri , false , out expectedAuthCode ) )
221
- . Returns ( true ) ;
218
+ ghAuthMock . Setup ( x => x . GetCredentialsAsync ( expectedTargetUri ) )
219
+ . ReturnsAsync ( new GitCredential ( expectedUserName , expectedPassword ) ) ;
220
+ ghAuthMock . Setup ( x => x . GetAuthenticationCodeAsync ( expectedTargetUri , false ) )
221
+ . ReturnsAsync ( expectedAuthCode ) ;
222
222
223
223
var ghApiMock = new Mock < IGitHubRestApi > ( MockBehavior . Strict ) ;
224
224
ghApiMock . Setup ( x => x . AcquireTokenAsync ( expectedTargetUri , expectedUserName , expectedPassword , null , It . IsAny < IEnumerable < string > > ( ) ) )
0 commit comments