8
8
using GitHubExtension . DataModel . DataObjects ;
9
9
using GitHubExtension . DeveloperId ;
10
10
using GitHubExtension . Test . Helpers ;
11
+ using Moq ;
11
12
using Octokit ;
12
13
13
14
namespace GitHubExtension . Test . DataStoreTests ;
@@ -30,7 +31,8 @@ public void AddUserFromOctokit()
30
31
"octokit" ,
31
32
} ;
32
33
33
- var client = new GitHubClientProvider ( new DeveloperIdProvider ( ) ) . GetClient ( ) ;
34
+ var mockCredentialVault = new Mock < ICredentialVault > ( ) ;
35
+ var client = new GitHubClientProvider ( new DeveloperIdProvider ( mockCredentialVault . Object ) ) . GetClient ( ) ;
34
36
using var tx = dataStore . Connection ! . BeginTransaction ( ) ;
35
37
foreach ( var item in items )
36
38
{
@@ -82,7 +84,8 @@ public void AddRepositoryFromOctokit()
82
84
Tuple . Create ( "microsoft" , "WindowsAppSDK" ) ,
83
85
} ;
84
86
85
- var client = new GitHubClientProvider ( new DeveloperIdProvider ( ) ) . GetClient ( ) ;
87
+ var mockCredentialVault = new Mock < ICredentialVault > ( ) ;
88
+ var client = new GitHubClientProvider ( new DeveloperIdProvider ( mockCredentialVault . Object ) ) . GetClient ( ) ;
86
89
using var tx = dataStore . Connection ! . BeginTransaction ( ) ;
87
90
foreach ( var item in items )
88
91
{
@@ -154,7 +157,8 @@ public void AddPullRequestFromOctokit()
154
157
Tuple . Create ( "microsoft" , "WindowsAppSDK" , 3482 , 2 ) ,
155
158
} ;
156
159
157
- var client = new GitHubClientProvider ( new DeveloperIdProvider ( ) ) . GetClient ( ) ;
160
+ var mockCredentialVault = new Mock < ICredentialVault > ( ) ;
161
+ var client = new GitHubClientProvider ( new DeveloperIdProvider ( mockCredentialVault . Object ) ) . GetClient ( ) ;
158
162
using var tx = dataStore . Connection ! . BeginTransaction ( ) ;
159
163
160
164
foreach ( var repo in repositories )
@@ -249,7 +253,8 @@ public void AddIssueFromOctokit()
249
253
Tuple . Create ( "microsoft" , "WindowsAppSDK" , 12 , 2 ) ,
250
254
} ;
251
255
252
- var client = new GitHubClientProvider ( new DeveloperIdProvider ( ) ) . GetClient ( ) ;
256
+ var mockCredentialVault = new Mock < ICredentialVault > ( ) ;
257
+ var client = new GitHubClientProvider ( new DeveloperIdProvider ( mockCredentialVault . Object ) ) . GetClient ( ) ;
253
258
using var tx = dataStore . Connection ! . BeginTransaction ( ) ;
254
259
255
260
foreach ( var repo in repositories )
@@ -326,7 +331,8 @@ public void AddPullRequestLabelFromOctokit()
326
331
dataStore . Create ( ) ;
327
332
Assert . IsNotNull ( dataStore . Connection ) ;
328
333
329
- var client = new GitHubClientProvider ( new DeveloperIdProvider ( ) ) . GetClient ( ) ;
334
+ var mockCredentialVault = new Mock < ICredentialVault > ( ) ;
335
+ var client = new GitHubClientProvider ( new DeveloperIdProvider ( mockCredentialVault . Object ) ) . GetClient ( ) ;
330
336
331
337
using var tx = dataStore . Connection ! . BeginTransaction ( ) ;
332
338
@@ -382,7 +388,8 @@ public void AddIssueLabelFromOctokit()
382
388
dataStore . Create ( ) ;
383
389
Assert . IsNotNull ( dataStore . Connection ) ;
384
390
385
- var client = new GitHubClientProvider ( new DeveloperIdProvider ( ) ) . GetClient ( ) ;
391
+ var mockCredentialVault = new Mock < ICredentialVault > ( ) ;
392
+ var client = new GitHubClientProvider ( new DeveloperIdProvider ( mockCredentialVault . Object ) ) . GetClient ( ) ;
386
393
387
394
using var tx = dataStore . Connection ! . BeginTransaction ( ) ;
388
395
0 commit comments