@@ -48,7 +48,8 @@ public void GitProcess_GetConfiguration_ReturnsConfiguration()
48
48
string gitPath = GetGitPath ( ) ;
49
49
var trace = new NullTrace ( ) ;
50
50
var env = new TestEnvironment ( ) ;
51
- var git = new GitProcess ( trace , env , gitPath ) ;
51
+ var processManager = new TestProcessManager ( ) ;
52
+ var git = new GitProcess ( trace , processManager , gitPath ) ;
52
53
var config = git . GetConfiguration ( ) ;
53
54
Assert . NotNull ( config ) ;
54
55
}
@@ -71,7 +72,8 @@ public void GitConfiguration_Enumerate_CallbackReturnsTrue_InvokesCallbackForEac
71
72
string gitPath = GetGitPath ( ) ;
72
73
var trace = new NullTrace ( ) ;
73
74
var env = new TestEnvironment ( ) ;
74
- var git = new GitProcess ( trace , env , gitPath , repoPath ) ;
75
+ var processManager = new TestProcessManager ( ) ;
76
+ var git = new GitProcess ( trace , processManager , gitPath , repoPath ) ;
75
77
IGitConfiguration config = git . GetConfiguration ( ) ;
76
78
77
79
var actualVisitedEntries = new List < ( string name , string value ) > ( ) ;
@@ -109,7 +111,8 @@ public void GitConfiguration_Enumerate_CallbackReturnsFalse_InvokesCallbackForEa
109
111
string gitPath = GetGitPath ( ) ;
110
112
var trace = new NullTrace ( ) ;
111
113
var env = new TestEnvironment ( ) ;
112
- var git = new GitProcess ( trace , env , gitPath , repoPath ) ;
114
+ var processManager = new TestProcessManager ( ) ;
115
+ var git = new GitProcess ( trace , processManager , gitPath , repoPath ) ;
113
116
IGitConfiguration config = git . GetConfiguration ( ) ;
114
117
115
118
var actualVisitedEntries = new List < ( string name , string value ) > ( ) ;
@@ -139,7 +142,9 @@ public void GitConfiguration_TryGet_Name_Exists_ReturnsTrueOutString()
139
142
string gitPath = GetGitPath ( ) ;
140
143
var trace = new NullTrace ( ) ;
141
144
var env = new TestEnvironment ( ) ;
142
- var git = new GitProcess ( trace , env , gitPath , repoPath ) ;
145
+ var processManager = new TestProcessManager ( ) ;
146
+
147
+ var git = new GitProcess ( trace , processManager , gitPath , repoPath ) ;
143
148
IGitConfiguration config = git . GetConfiguration ( ) ;
144
149
145
150
bool result = config . TryGet ( "user.name" , false , out string value ) ;
@@ -156,7 +161,8 @@ public void GitConfiguration_TryGet_Name_DoesNotExists_ReturnsFalse()
156
161
string gitPath = GetGitPath ( ) ;
157
162
var trace = new NullTrace ( ) ;
158
163
var env = new TestEnvironment ( ) ;
159
- var git = new GitProcess ( trace , env , gitPath , repoPath ) ;
164
+ var processManager = new TestProcessManager ( ) ;
165
+ var git = new GitProcess ( trace , processManager , gitPath , repoPath ) ;
160
166
IGitConfiguration config = git . GetConfiguration ( ) ;
161
167
162
168
string randomName = $ "{ Guid . NewGuid ( ) : N} .{ Guid . NewGuid ( ) : N} ";
@@ -175,7 +181,8 @@ public void GitConfiguration_TryGet_IsPath_True_ReturnsCanonicalPath()
175
181
string gitPath = GetGitPath ( ) ;
176
182
var trace = new NullTrace ( ) ;
177
183
var env = new TestEnvironment ( ) ;
178
- var git = new GitProcess ( trace , env , gitPath , repoPath ) ;
184
+ var processManager = new TestProcessManager ( ) ;
185
+ var git = new GitProcess ( trace , processManager , gitPath , repoPath ) ;
179
186
IGitConfiguration config = git . GetConfiguration ( ) ;
180
187
181
188
bool result = config . TryGet ( "example.path" , true , out string value ) ;
@@ -193,7 +200,8 @@ public void GitConfiguration_TryGet_IsPath_False_ReturnsRawConfig()
193
200
string gitPath = GetGitPath ( ) ;
194
201
var trace = new NullTrace ( ) ;
195
202
var env = new TestEnvironment ( ) ;
196
- var git = new GitProcess ( trace , env , gitPath , repoPath ) ;
203
+ var processManager = new TestProcessManager ( ) ;
204
+ var git = new GitProcess ( trace , processManager , gitPath , repoPath ) ;
197
205
IGitConfiguration config = git . GetConfiguration ( ) ;
198
206
199
207
bool result = config . TryGet ( "example.path" , false , out string value ) ;
@@ -211,7 +219,8 @@ public void GitConfiguration_TryGet_BoolType_ReturnsCanonicalBool()
211
219
string gitPath = GetGitPath ( ) ;
212
220
var trace = new NullTrace ( ) ;
213
221
var env = new TestEnvironment ( ) ;
214
- var git = new GitProcess ( trace , env , gitPath , repoPath ) ;
222
+ var processManager = new TestProcessManager ( ) ;
223
+ var git = new GitProcess ( trace , processManager , gitPath , repoPath ) ;
215
224
IGitConfiguration config = git . GetConfiguration ( ) ;
216
225
217
226
bool result = config . TryGet ( GitConfigurationLevel . Local , GitConfigurationType . Bool ,
@@ -230,7 +239,8 @@ public void GitConfiguration_TryGet_BoolWithoutType_ReturnsRawConfig()
230
239
string gitPath = GetGitPath ( ) ;
231
240
var trace = new NullTrace ( ) ;
232
241
var env = new TestEnvironment ( ) ;
233
- var git = new GitProcess ( trace , env , gitPath , repoPath ) ;
242
+ var processManager = new TestProcessManager ( ) ;
243
+ var git = new GitProcess ( trace , processManager , gitPath , repoPath ) ;
234
244
IGitConfiguration config = git . GetConfiguration ( ) ;
235
245
236
246
bool result = config . TryGet ( GitConfigurationLevel . Local , GitConfigurationType . Raw ,
@@ -249,7 +259,8 @@ public void GitConfiguration_Get_Name_Exists_ReturnsString()
249
259
string gitPath = GetGitPath ( ) ;
250
260
var trace = new NullTrace ( ) ;
251
261
var env = new TestEnvironment ( ) ;
252
- var git = new GitProcess ( trace , env , gitPath , repoPath ) ;
262
+ var processManager = new TestProcessManager ( ) ;
263
+ var git = new GitProcess ( trace , processManager , gitPath , repoPath ) ;
253
264
IGitConfiguration config = git . GetConfiguration ( ) ;
254
265
255
266
string value = config . Get ( "user.name" ) ;
@@ -265,7 +276,8 @@ public void GitConfiguration_Get_Name_DoesNotExists_ThrowsException()
265
276
string gitPath = GetGitPath ( ) ;
266
277
var trace = new NullTrace ( ) ;
267
278
var env = new TestEnvironment ( ) ;
268
- var git = new GitProcess ( trace , env , gitPath , repoPath ) ;
279
+ var processManager = new TestProcessManager ( ) ;
280
+ var git = new GitProcess ( trace , processManager , gitPath , repoPath ) ;
269
281
IGitConfiguration config = git . GetConfiguration ( ) ;
270
282
271
283
string randomName = $ "{ Guid . NewGuid ( ) : N} .{ Guid . NewGuid ( ) : N} ";
@@ -280,7 +292,8 @@ public void GitConfiguration_Set_Local_SetsLocalConfig()
280
292
string gitPath = GetGitPath ( ) ;
281
293
var trace = new NullTrace ( ) ;
282
294
var env = new TestEnvironment ( ) ;
283
- var git = new GitProcess ( trace , env , gitPath , repoPath ) ;
295
+ var processManager = new TestProcessManager ( ) ;
296
+ var git = new GitProcess ( trace , processManager , gitPath , repoPath ) ;
284
297
IGitConfiguration config = git . GetConfiguration ( ) ;
285
298
286
299
config . Set ( GitConfigurationLevel . Local , "core.foobar" , "foo123" ) ;
@@ -298,7 +311,8 @@ public void GitConfiguration_Set_All_ThrowsException()
298
311
string gitPath = GetGitPath ( ) ;
299
312
var trace = new NullTrace ( ) ;
300
313
var env = new TestEnvironment ( ) ;
301
- var git = new GitProcess ( trace , env , gitPath , repoPath ) ;
314
+ var processManager = new TestProcessManager ( ) ;
315
+ var git = new GitProcess ( trace , processManager , gitPath , repoPath ) ;
302
316
IGitConfiguration config = git . GetConfiguration ( ) ;
303
317
304
318
Assert . Throws < InvalidOperationException > ( ( ) => config . Set ( GitConfigurationLevel . All , "core.foobar" , "test123" ) ) ;
@@ -317,7 +331,8 @@ public void GitConfiguration_Unset_Global_UnsetsGlobalConfig()
317
331
string gitPath = GetGitPath ( ) ;
318
332
var trace = new NullTrace ( ) ;
319
333
var env = new TestEnvironment ( ) ;
320
- var git = new GitProcess ( trace , env , gitPath , repoPath ) ;
334
+ var processManager = new TestProcessManager ( ) ;
335
+ var git = new GitProcess ( trace , processManager , gitPath , repoPath ) ;
321
336
IGitConfiguration config = git . GetConfiguration ( ) ;
322
337
323
338
config . Unset ( GitConfigurationLevel . Global , "core.foobar" ) ;
@@ -348,7 +363,8 @@ public void GitConfiguration_Unset_Local_UnsetsLocalConfig()
348
363
string gitPath = GetGitPath ( ) ;
349
364
var trace = new NullTrace ( ) ;
350
365
var env = new TestEnvironment ( ) ;
351
- var git = new GitProcess ( trace , env , gitPath , repoPath ) ;
366
+ var processManager = new TestProcessManager ( ) ;
367
+ var git = new GitProcess ( trace , processManager , gitPath , repoPath ) ;
352
368
IGitConfiguration config = git . GetConfiguration ( ) ;
353
369
354
370
config . Unset ( GitConfigurationLevel . Local , "core.foobar" ) ;
@@ -374,7 +390,8 @@ public void GitConfiguration_Unset_All_ThrowsException()
374
390
string gitPath = GetGitPath ( ) ;
375
391
var trace = new NullTrace ( ) ;
376
392
var env = new TestEnvironment ( ) ;
377
- var git = new GitProcess ( trace , env , gitPath , repoPath ) ;
393
+ var processManager = new TestProcessManager ( ) ;
394
+ var git = new GitProcess ( trace , processManager , gitPath , repoPath ) ;
378
395
IGitConfiguration config = git . GetConfiguration ( ) ;
379
396
380
397
Assert . Throws < InvalidOperationException > ( ( ) => config . Unset ( GitConfigurationLevel . All , "core.foobar" ) ) ;
@@ -391,7 +408,8 @@ public void GitConfiguration_UnsetAll_UnsetsAllConfig()
391
408
string gitPath = GetGitPath ( ) ;
392
409
var trace = new NullTrace ( ) ;
393
410
var env = new TestEnvironment ( ) ;
394
- var git = new GitProcess ( trace , env , gitPath , repoPath ) ;
411
+ var processManager = new TestProcessManager ( ) ;
412
+ var git = new GitProcess ( trace , processManager , gitPath , repoPath ) ;
395
413
IGitConfiguration config = git . GetConfiguration ( ) ;
396
414
397
415
config . UnsetAll ( GitConfigurationLevel . Local , "core.foobar" , "foo*" ) ;
@@ -409,7 +427,8 @@ public void GitConfiguration_UnsetAll_All_ThrowsException()
409
427
string gitPath = GetGitPath ( ) ;
410
428
var trace = new NullTrace ( ) ;
411
429
var env = new TestEnvironment ( ) ;
412
- var git = new GitProcess ( trace , env , gitPath , repoPath ) ;
430
+ var processManager = new TestProcessManager ( ) ;
431
+ var git = new GitProcess ( trace , processManager , gitPath , repoPath ) ;
413
432
IGitConfiguration config = git . GetConfiguration ( ) ;
414
433
415
434
Assert . Throws < InvalidOperationException > ( ( ) => config . UnsetAll ( GitConfigurationLevel . All , "core.foobar" , Constants . RegexPatterns . Any ) ) ;
0 commit comments