@@ -31,7 +31,8 @@ public async Task LogsTheUserInSuccessfullyAndCachesRelevantInfo()
3131 var hostCache = new InMemoryBlobCache ( ) ;
3232 var modelService = new ModelService ( apiClient , hostCache , Substitute . For < IAvatarProvider > ( ) ) ;
3333 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 ) ;
3536
3637 var result = await host . LogIn ( "baymax" , "aPassword" ) ;
3738
@@ -57,7 +58,8 @@ public async Task DoesNotLogInWhenRetrievingOauthTokenFails()
5758 var hostCache = new InMemoryBlobCache ( ) ;
5859 var modelService = new ModelService ( apiClient , hostCache , Substitute . For < IAvatarProvider > ( ) ) ;
5960 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 ) ;
6163
6264 await Assert . ThrowsAsync < NotFoundException > ( async ( ) => await host . LogIn ( "jiminy" , "cricket" ) ) ;
6365
@@ -85,7 +87,8 @@ public async Task UsesUsernameAndPasswordInsteadOfAuthorizationTokenWhenEnterpri
8587 var hostCache = new InMemoryBlobCache ( ) ;
8688 var modelService = new ModelService ( apiClient , hostCache , Substitute . For < IAvatarProvider > ( ) ) ;
8789 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 ) ;
8992
9093 var result = await host . LogIn ( "Cthulu" , "aPassword" ) ;
9194
@@ -126,7 +129,8 @@ public async Task DoesNotFallBackToOldScopesWhenGitHubAndTwoFactorAuthFailsAndEr
126129 var hostCache = new InMemoryBlobCache ( ) ;
127130 var modelService = new ModelService ( apiClient , hostCache , Substitute . For < IAvatarProvider > ( ) ) ;
128131 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 ) ;
130134
131135 await host . LogIn ( "aUsername" , "aPassowrd" ) ;
132136
@@ -152,7 +156,8 @@ public async Task RetriesUsingOldScopeWhenAuthenticationFailsAndIsEnterprise()
152156 var hostCache = new InMemoryBlobCache ( ) ;
153157 var modelService = new ModelService ( apiClient , hostCache , Substitute . For < IAvatarProvider > ( ) ) ;
154158 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 ) ;
156161
157162 await host . LogIn ( "jiminy" , "aPassowrd" ) ;
158163
@@ -171,7 +176,8 @@ public async Task SupportsGistIsTrueWhenGistScopeIsPresent()
171176 var hostCache = new InMemoryBlobCache ( ) ;
172177 var modelService = new ModelService ( apiClient , hostCache , Substitute . For < IAvatarProvider > ( ) ) ;
173178 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 ) ;
175181
176182 var result = await host . LogIn ( "baymax" , "aPassword" ) ;
177183
@@ -188,7 +194,8 @@ public async Task SupportsGistIsFalseWhenGistScopeIsNotPresent()
188194 var hostCache = new InMemoryBlobCache ( ) ;
189195 var modelService = new ModelService ( apiClient , hostCache , Substitute . For < IAvatarProvider > ( ) ) ;
190196 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 ) ;
192199
193200 var result = await host . LogIn ( "baymax" , "aPassword" ) ;
194201
@@ -209,7 +216,8 @@ public async Task SupportsGistIsTrueWhenScopesAreNull()
209216 var hostCache = new InMemoryBlobCache ( ) ;
210217 var modelService = new ModelService ( apiClient , hostCache , Substitute . For < IAvatarProvider > ( ) ) ;
211218 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 ) ;
213221
214222 var result = await host . LogIn ( "baymax" , "aPassword" ) ;
215223
0 commit comments