@@ -31,7 +31,8 @@ public async Task LogsTheUserInSuccessfullyAndCachesRelevantInfo()
31
31
var hostCache = new InMemoryBlobCache ( ) ;
32
32
var modelService = new ModelService ( apiClient , hostCache , Substitute . For < IAvatarProvider > ( ) ) ;
33
33
var loginCache = new TestLoginCache ( ) ;
34
- var host = new RepositoryHost ( apiClient , modelService , loginCache , Substitute . For < ITwoFactorChallengeHandler > ( ) ) ;
34
+ var usage = Substitute . For < IUsageTracker > ( ) ;
35
+ var host = new RepositoryHost ( apiClient , modelService , loginCache , Substitute . For < ITwoFactorChallengeHandler > ( ) , usage ) ;
35
36
36
37
var result = await host . LogIn ( "baymax" , "aPassword" ) ;
37
38
@@ -57,7 +58,8 @@ public async Task DoesNotLogInWhenRetrievingOauthTokenFails()
57
58
var hostCache = new InMemoryBlobCache ( ) ;
58
59
var modelService = new ModelService ( apiClient , hostCache , Substitute . For < IAvatarProvider > ( ) ) ;
59
60
var loginCache = new TestLoginCache ( ) ;
60
- var host = new RepositoryHost ( apiClient , modelService , loginCache , Substitute . For < ITwoFactorChallengeHandler > ( ) ) ;
61
+ var usage = Substitute . For < IUsageTracker > ( ) ;
62
+ var host = new RepositoryHost ( apiClient , modelService , loginCache , Substitute . For < ITwoFactorChallengeHandler > ( ) , usage ) ;
61
63
62
64
await Assert . ThrowsAsync < NotFoundException > ( async ( ) => await host . LogIn ( "jiminy" , "cricket" ) ) ;
63
65
@@ -85,7 +87,8 @@ public async Task UsesUsernameAndPasswordInsteadOfAuthorizationTokenWhenEnterpri
85
87
var hostCache = new InMemoryBlobCache ( ) ;
86
88
var modelService = new ModelService ( apiClient , hostCache , Substitute . For < IAvatarProvider > ( ) ) ;
87
89
var loginCache = new TestLoginCache ( ) ;
88
- var host = new RepositoryHost ( apiClient , modelService , loginCache , Substitute . For < ITwoFactorChallengeHandler > ( ) ) ;
90
+ var usage = Substitute . For < IUsageTracker > ( ) ;
91
+ var host = new RepositoryHost ( apiClient , modelService , loginCache , Substitute . For < ITwoFactorChallengeHandler > ( ) , usage ) ;
89
92
90
93
var result = await host . LogIn ( "Cthulu" , "aPassword" ) ;
91
94
@@ -126,7 +129,8 @@ public async Task DoesNotFallBackToOldScopesWhenGitHubAndTwoFactorAuthFailsAndEr
126
129
var hostCache = new InMemoryBlobCache ( ) ;
127
130
var modelService = new ModelService ( apiClient , hostCache , Substitute . For < IAvatarProvider > ( ) ) ;
128
131
var loginCache = new TestLoginCache ( ) ;
129
- var host = new RepositoryHost ( apiClient , modelService , loginCache , Substitute . For < ITwoFactorChallengeHandler > ( ) ) ;
132
+ var usage = Substitute . For < IUsageTracker > ( ) ;
133
+ var host = new RepositoryHost ( apiClient , modelService , loginCache , Substitute . For < ITwoFactorChallengeHandler > ( ) , usage ) ;
130
134
131
135
await host . LogIn ( "aUsername" , "aPassowrd" ) ;
132
136
@@ -152,7 +156,8 @@ public async Task RetriesUsingOldScopeWhenAuthenticationFailsAndIsEnterprise()
152
156
var hostCache = new InMemoryBlobCache ( ) ;
153
157
var modelService = new ModelService ( apiClient , hostCache , Substitute . For < IAvatarProvider > ( ) ) ;
154
158
var loginCache = new TestLoginCache ( ) ;
155
- var host = new RepositoryHost ( apiClient , modelService , loginCache , Substitute . For < ITwoFactorChallengeHandler > ( ) ) ;
159
+ var usage = Substitute . For < IUsageTracker > ( ) ;
160
+ var host = new RepositoryHost ( apiClient , modelService , loginCache , Substitute . For < ITwoFactorChallengeHandler > ( ) , usage ) ;
156
161
157
162
await host . LogIn ( "jiminy" , "aPassowrd" ) ;
158
163
@@ -171,7 +176,8 @@ public async Task SupportsGistIsTrueWhenGistScopeIsPresent()
171
176
var hostCache = new InMemoryBlobCache ( ) ;
172
177
var modelService = new ModelService ( apiClient , hostCache , Substitute . For < IAvatarProvider > ( ) ) ;
173
178
var loginCache = new TestLoginCache ( ) ;
174
- var host = new RepositoryHost ( apiClient , modelService , loginCache , Substitute . For < ITwoFactorChallengeHandler > ( ) ) ;
179
+ var usage = Substitute . For < IUsageTracker > ( ) ;
180
+ var host = new RepositoryHost ( apiClient , modelService , loginCache , Substitute . For < ITwoFactorChallengeHandler > ( ) , usage ) ;
175
181
176
182
var result = await host . LogIn ( "baymax" , "aPassword" ) ;
177
183
@@ -188,7 +194,8 @@ public async Task SupportsGistIsFalseWhenGistScopeIsNotPresent()
188
194
var hostCache = new InMemoryBlobCache ( ) ;
189
195
var modelService = new ModelService ( apiClient , hostCache , Substitute . For < IAvatarProvider > ( ) ) ;
190
196
var loginCache = new TestLoginCache ( ) ;
191
- var host = new RepositoryHost ( apiClient , modelService , loginCache , Substitute . For < ITwoFactorChallengeHandler > ( ) ) ;
197
+ var usage = Substitute . For < IUsageTracker > ( ) ;
198
+ var host = new RepositoryHost ( apiClient , modelService , loginCache , Substitute . For < ITwoFactorChallengeHandler > ( ) , usage ) ;
192
199
193
200
var result = await host . LogIn ( "baymax" , "aPassword" ) ;
194
201
@@ -209,7 +216,8 @@ public async Task SupportsGistIsTrueWhenScopesAreNull()
209
216
var hostCache = new InMemoryBlobCache ( ) ;
210
217
var modelService = new ModelService ( apiClient , hostCache , Substitute . For < IAvatarProvider > ( ) ) ;
211
218
var loginCache = new TestLoginCache ( ) ;
212
- var host = new RepositoryHost ( apiClient , modelService , loginCache , Substitute . For < ITwoFactorChallengeHandler > ( ) ) ;
219
+ var usage = Substitute . For < IUsageTracker > ( ) ;
220
+ var host = new RepositoryHost ( apiClient , modelService , loginCache , Substitute . For < ITwoFactorChallengeHandler > ( ) , usage ) ;
213
221
214
222
var result = await host . LogIn ( "baymax" , "aPassword" ) ;
215
223
0 commit comments